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

Allow for capturing mouse when menus and context menus are open. #3965

Closed
MarchingCube opened this issue May 20, 2020 · 3 comments · Fixed by #4099
Closed

Allow for capturing mouse when menus and context menus are open. #3965

MarchingCube opened this issue May 20, 2020 · 3 comments · Fixed by #4099

Comments

@MarchingCube
Copy link
Contributor

Currently when menus and context menus are open we can still partly interact with the rest of the application via pointer over effects and tooltips (and more). Most of the UI frameworks like WPF/Qt prevent such interaction as it is confusing for the user.

Ideally when context menu is open user should be able to interact with the menu itself and nothing in the main app.

@kekekeks
Copy link
Member

user should be able to interact with the menu itself

There are parent menus though.

@MarchingCube
Copy link
Contributor Author

@kekekeks I mean that user should be able to interact with the whole open context or menu hierarchy. Including children but excluding context that does not belong to the menu itself.

@MarchingCube
Copy link
Contributor Author

I've noticed one more pointer capture difference:

WPF:
context-menu

Avalonia:
context-menu-avalonia

In WPF items do not capture mouse pointer which allows you to select other menu item even after initial click on a different menu item.

grokys added a commit that referenced this issue Jun 10, 2020
WPF uses a capture on the mouse but that isn't feasible in Avalonia as we need a pointer event in order to capture the pointer. Instead filter move/wheel/leave events on toplevel.

Fixes #3965
@grokys grokys mentioned this issue Jun 10, 2020
3 tasks
grokys added a commit that referenced this issue Jul 9, 2020
WPF uses a capture on the mouse but that isn't feasible in Avalonia as we need a pointer event in order to capture the pointer. Instead filter move/wheel/leave events on toplevel.

Fixes #3965
grokys added a commit that referenced this issue Jul 10, 2020
Which implements something similar to UWP's `FlyoutBase.OverlayInputPassThroughElement`. With this feature, `Menu`/`MenuItem` can use `IsLightDismissEnabled="True"` fixing #3965 for top-level menus.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants