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

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

jquesada2016
Copy link
Contributor

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
Contributor 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.

Co-authored-by: Jose Quesada <jquesada2016@fau.edu>
@hecrj hecrj added this to the 0.13 milestone Sep 5, 2024
@hecrj hecrj added feature New feature or request shell addition labels Sep 5, 2024
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@hecrj hecrj enabled auto-merge September 5, 2024 09:15
@hecrj hecrj merged commit b5cbb4a into iced-rs:master Sep 5, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition feature New feature or request shell
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants