mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
Add 'WindowEvent::Occluded(bool)'
This commits and an event to track window occlusion state, which could help optimize rendering downstream.
This commit is contained in:
@@ -531,8 +531,13 @@ impl<T: 'static> EventProcessor<T> {
|
||||
ffi::VisibilityNotify => {
|
||||
let xev: &ffi::XVisibilityEvent = xev.as_ref();
|
||||
let xwindow = xev.window;
|
||||
|
||||
self.with_window(xwindow, |window| window.visibility_notify());
|
||||
callback(Event::WindowEvent {
|
||||
window_id: mkwid(xwindow),
|
||||
event: WindowEvent::Occluded(xev.state == ffi::VisibilityFullyObscured),
|
||||
});
|
||||
self.with_window(xwindow, |window| {
|
||||
window.visibility_notify();
|
||||
});
|
||||
}
|
||||
|
||||
ffi::Expose => {
|
||||
|
||||
Reference in New Issue
Block a user