egui icon indicating copy to clipboard operation
egui copied to clipboard

Add an option to allow input to pass through a window

Open popcar2 opened this issue 2 years ago • 1 comments

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 avatar May 24 '22 12:05 popcar2

this might soon be possible with https://github.com/rust-windowing/winit/pull/2232

coderedart avatar May 24 '22 13:05 coderedart

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.

mgalos999 avatar Sep 24 '22 15:09 mgalos999

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.

chastise avatar Dec 22 '22 02:12 chastise