-
Notifications
You must be signed in to change notification settings - Fork 669
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
WinUI 3 custom title bar captures focus from flyouts #9463
Comments
You could set flyout shouldconstraintorootbounds false |
When using Flyout.ShouldConstrainToRootBounds="False", it works around the problem and items can be selected, but it still does not solve the original issue. Using unconstrained flyouts trigger other crashes in WinUI when trying to hide the flyout from code behind. In that case a native 0x80070057 "The parameter is incorrect" exception is thrown and crashing the application. |
dup |
For non-windowed flyouts, it might be good for flyout positioning code to ensure the flyout doesn't overlap the titlebar area. Or, alternatively, maybe the flyout could use InputNonClientPointerSource to ensure it gets input even if it is in the titlebar area. |
Is there any sample? |
Describe the bug
When using a custom title bar that extends own content into the title bar, flyouts that are opened from the page UI over the custom title bar receive no input.
The mouse input is interpreted as a hover and click on the title bar, not on the items in the flyout.
Trying to click on or select the top item in the flyout is impossible and is instead interpreted as a window movement when clicking and dragging.
Double-clicking on the top flyout item maximizes the window instead of selecting the flyout item.
Also, the title bar control buttons for minimize, maximize and closing the window are given priority over the flyout that is displayed above.
Steps to reproduce the bug
Reproduction sample code is available here: https://github.com/kjean667/WinUICustomTitleAndFlyoutBug
Use AppWindowTitleBar.ExtendsContentIntoTitleBar and SetDragRectangles to extend custom content into the title bar of the window.
(See WindowTitleHelper.cs in reproduction sample)
Use a simple XAML Window with a Flyout that is tall enough to open over the custom title bar. The Window needs to be the exact right size so that the Flyout is extended over the title bar content.
Expected behavior
The first item in the flyout shall be clickable and when hovering over the item the focus background shall be displayed.
Screenshots
NuGet package version
WinUI 3 - Windows App SDK 1.5.1: 1.5.240311000
Windows version
No response
Additional context
Windows 11 23H2 (22631.3155)
The text was updated successfully, but these errors were encountered: