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:
parent
4b10993970
commit
e289f30e5d
4 changed files with 39 additions and 3 deletions
|
|
@ -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 => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue