On Web, implement WindowEvent::Occluded (#2940)
This commit is contained in:
parent
bd890e69aa
commit
5e0e1e96bc
9 changed files with 165 additions and 9 deletions
|
|
@ -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> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue