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

Added mouse passthrough window option #69

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

Conversation

mgalos999
Copy link

Closes #68

Turns out bumping the version of glutin to 0.29.1 makes this function available:
self.window_context.window().set_cursor_hittest(!passthrough).unwrap();
which makes mouse passthrough events possible.
WindowCreationOptions now has .with_mouse_passthrough(bool)

However with then newer version of Glutin, cursor grab is changed from a bool to an enum CursorGrabMode.
I did a somewhat ugly hack for this so I might need some advice on the best way to fix it up.

@QuantumBadger
Copy link
Owner

Thank you, and sorry for the delay in reviewing!

I've tested this on Linux and unfortunately, even if the user doesn't enable passthrough, this crashes every time with
SetMousePassthroughFailed. I think to fix this, we should only invoke the set_cursor_hittest API if the user has enabled options.mouse_passthrough -- otherwise we should just not invoke the API.

Otherwise this looks great, I think it should be possible to merge this with the above change. Thanks again!

@InfiniteCoder01
Copy link
Contributor

Sorry for bumping up this old thread, but I wanted to create an overlay and there really isn't much options. Is this planned to be supported?

@NadyaNayme
Copy link

I'm also using Speedy2D in hopes of making a quick & dirty overlay and while not a total blocker (pun unintended) it would be a big improvement if the overlay could be made passthrough.

I saw in #99 that the reason the examples don't compile is because they are for 2.0 which has yet-to-release. Is this something that is maybe addressed by 2.0?

@Airyzz
Copy link

Airyzz commented May 17, 2024

I noticed in master the glutin version has been updated to 0.31.3, any change of this being revisited now that Speedy2D is using a version which should support it?

@alois-git
Copy link

Same request here, I use it as well for a quick and dirty overlay and passthrough would be great :)

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.

Mouse passthrough
6 participants