Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken hit testing on extended title bar when maximized #8805

Open
BreeceW opened this issue Aug 30, 2023 · 4 comments
Open

Broken hit testing on extended title bar when maximized #8805

BreeceW opened this issue Aug 30, 2023 · 4 comments
Labels
area-AppWindow bug Something isn't working team-CompInput Issue for IXP (Composition, Input) team

Comments

@BreeceW
Copy link
Contributor

BreeceW commented Aug 30, 2023

Describe the bug

In Windows App SDK 1.4+, it is not possible to interact with the edges of the title bar for an AppWindow or WinUI 3 Window with ExtendsContentIntoTitleBar set to true when the window is maximized. This means that users are not able to click on the close/restore/minimize buttons if the cursor is in the topmost or rightmost position on screen. This also breaks restoring a window by dragging it from the very top or farthest sides of the title bar.

Instead of showing the correct cursor and performing the correct action, the cursor on the edges of the title bar becomes a resize cursor, although no resizing occurs.

Steps to reproduce the bug

  1. Create a blank WinUI 3 app
  2. In the constructor of MainWindow, set ExtendsContentIntoTitleBar = true
  3. Run the app
  4. Maximize the window
  5. Move your cursor to the top right of the screen. Note that the close button will not highlight red and clicking does nothing and the cursor is a resize cursor (see similar effect on minimize and restore buttons on top edge)
  6. Move your cursor to the top center of the screen and click and drag down. Note the window does not restore and move and the cursor is a resize cursor
  7. Issue occurs on far left edge, far right edge, and top edge, as well as top left and right corners

Expected behavior

The title bar should behave (perform hit testing) like the default Windows title bar. Users should be able to interact with window controls on the far edges and corners of the screen when windows are maximized.

Screenshots

Laptop screen with WinUI 3 window with extended title bar. Cursor is in top right of screen and is a NESW drag cursor

This is the cursor showing in the top right corner:
NESW drag cursor

It should be a normal arrow cursor, and the button should be red when hovered (and close the window when clicked):
Arrow cursor

NuGet package version

Microsoft.WindowsAppSDK 1.4.230822000
Microsoft.WindowsAppSDK 1.5.240311000

Windows version

Windows 11 (22H2): Build 22621

@BreeceW BreeceW added the bug Something isn't working label Aug 30, 2023
@Splitwirez
Copy link

Shoutout to Fitt's Law

@0x5bfa
Copy link

0x5bfa commented May 12, 2024

Isn't this issue related to WinAppSdk rather than WinUI?

@BreeceW
Copy link
Contributor Author

BreeceW commented May 12, 2024

Isn't this issue related to WinAppSdk rather than WinUI?

Arguably yes, this issue is in Microsoft.UI.Windowing. However, it has already been categorized in this repo under area-AppWindow and not moved to the Windows App SDK repo, so it should be fine here.

The March 2024 WinUI Community Call indicated a better title bar experience is in the roadmap for Windows App SDK 1.6, so hopefully this is fixed on that timeframe.

@0x5bfa
Copy link

0x5bfa commented May 12, 2024

Thanks for the quick response, I hope so!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-AppWindow bug Something isn't working team-CompInput Issue for IXP (Composition, Input) team
Projects
None yet
Development

No branches or pull requests

4 participants