mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 23:23:14 -04:00
On Web, implement WindowEvent::Occluded (#2940)
This commit is contained in:
committed by
Kirill Chibisov
parent
7a4ce631bd
commit
5fa4b8f003
@@ -720,6 +720,16 @@ impl<T> EventLoopWindowTarget<T> {
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
let runner = self.runner.clone();
|
||||
canvas.on_intersection(move |is_intersecting| {
|
||||
if backend::is_visible(runner.window()) {
|
||||
runner.send_event(Event::WindowEvent {
|
||||
window_id: RootWindowId(id),
|
||||
event: WindowEvent::Occluded(!is_intersecting),
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub fn available_monitors(&self) -> VecDequeIter<MonitorHandle> {
|
||||
|
||||
Reference in New Issue
Block a user