Speedy2D icon indicating copy to clipboard operation
Speedy2D copied to clipboard

Added mouse passthrough window option

Open mgalos999 opened this issue 2 years ago • 5 comments

Closes https://github.com/QuantumBadger/Speedy2D/issues/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.

mgalos999 avatar Oct 01 '22 12:10 mgalos999

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!

QuantumBadger avatar Oct 08 '22 09:10 QuantumBadger

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?

InfiniteCoder01 avatar Aug 11 '23 10:08 InfiniteCoder01

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?

NadyaNayme avatar Sep 18 '23 21:09 NadyaNayme

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?

Airyzz avatar May 17 '24 02:05 Airyzz

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

alois-git avatar May 21 '24 08:05 alois-git