WinUI 3 Window.ExtendsContentIntoTitleBar caption buttons can be clicked when mouse is not over them
See original GitHub issueDescribe the bug
When a user presses the left mouse button down over a caption button (i.e., Minimize, Restore/Maximize, Close) in the title bar when the title bar has been customized using Window.ExtendsContentIntoTitleBar
, the button will still be clicked even if the user has moved their mouse off of the button.
Steps to reproduce the bug
- Customize a WinUI 3 window where
Window.ExtendsContentIntoTitleBar = true
(you can use the WinUI 3 Gallery app as an example) - Hover over the close button (this issue affects minimize and maximize as well), and click the left mouse button down
- Move the mouse away from the close button (the close button will still appear in the pressed visual state)
- Release the left mouse button
- The window will close
Expected behavior
The button should not be clicked if the left mouse button is released when cursor has moved off the caption button. Additionally, the button should not appear in the pressed visual state if the cursor is not over it.
Screenshots
The expected behavior when using the standard title bar:
The problematic behavior when using Window.ExtendsContentIntoTitleBar
:
NuGet package version
WinUI 3 - Windows App SDK 1.1.1
Windows app type
- ☐ UWP
- 🗹 Win32
Device form factor
Desktop
Windows version
Windows 11 (22H2): Build 22621
Additional context
This is an important usability issue because these caption buttons behave differently from every other Windows caption buttons and has the potential to cause loss of work. If, for instance, a user inadvertently clicks their mouse button down on the close button, the window will close once they release the mouse button, and there is nothing they can do about it. The correct behavior would allow the user to move the cursor off the close button and safely release the mouse button.
Note that this issue only affects Window.ExtendsContentIntoTitleBar
and not AppWindowTitleBar.ExtendsContentIntoTitleBar
or the default title bar.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:5 (3 by maintainers)
I am working to merge WinUI 3 custom titlebar with Appwindow titlebar in a way that winui 3 custom titlebar apis will internally call appwindow apis. so the behavior will start matching once that happens.
Thanks for reporting this bug. I am looking into it.