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

Add command for setting mouse passthrough #2284

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jquesada2016
Copy link

This PR addresses #2283 by exposing winit's ability to set mouse hit testing.

I extended the window::Action enum to include two new entries:

  • EnableMousePassthrough: enables the window passing through mouse events to whatever's underneath
  • DisableMousePassthrough: disables mouse passthrough, essentially allowing the window to capture mouse events

I also added two respective functions for creating these commands, enable_mouse_passthrough, and disable_mouse_passthrough.

@dtzxporter
Copy link
Contributor

May be a little verbose to have two actions when you could just make it iced::window::set_cursor_hittest(id, enabled) instead?

@jquesada2016
Copy link
Author

May be a little verbose to have two actions when you could just make it iced::window::set_cursor_hittest(id, enabled) instead?

@dtzxporter I do personally agree. I ended up splitting it into both because I tried sticking to the rest of the window::Action variants, and it felt more consistant this way. Also, using Set in the name implies to me there should be a mechanism for fetching the hit test state, which winit does not have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants