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 an option to allow input to pass through a window #1677

Closed
popcar2 opened this issue May 24, 2022 · 3 comments · Fixed by #2080
Closed

Add an option to allow input to pass through a window #1677

popcar2 opened this issue May 24, 2022 · 3 comments · Fixed by #2080
Labels
feature New feature or request

Comments

@popcar2
Copy link

popcar2 commented May 24, 2022

I'm trying to make an overlay for the entire screen that's always on top, and while almost everything works, it turns out egui doesn't support input to pass through its window. I removed window decorations, made the window transparent, and made it always on top, but it seems like you have to jump through many hoops to get input to pass through the window.

Someone made a good fork that allows input passthrough in egui but I was hoping there would be a native option for it so I can stick with eframe and updated versions of egui rather than rely on a fork. I'm not sure if this is an issue with egui itself or windowing libraries, but hopefully someone can take a look. Thanks.

Additional context
LBVAoljZWd

I talked more about what I'm trying to achieve in this discussion

@popcar2 popcar2 added the feature New feature or request label May 24, 2022
@coderedart
Copy link
Contributor

this might soon be possible with rust-windowing/winit#2232

@mgalos999
Copy link
Contributor

It works if you add this line to crates/eframe/src/native/run.rs at line 386
gl_window.window().set_cursor_hittest(false).unwrap();

If you add that line then all mouse events will pass through the window for all examples.

To do a proper solution you'd obviously want a config item been passed through rather than globally forcing it.

@chastise
Copy link

chastise commented Dec 22, 2022

To do a proper solution you'd obviously want a config item been passed through rather than globally forcing it.

Can you expand on what you mean by this? It looks like your flag was part of egui's v0.20.1 release, but it seems to cause the window to render everything transparent and click-through-able.

I'm pretty new to rust / egui, but I'm not able to figure out how I could access the flag you're setting from within a running egui application, or how I might configure it to apply only partially. In the interim, I'm using the egui_overlay fork linked in the original message.

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

Successfully merging a pull request may close this issue.

4 participants