On Wayland, disable Occluded handling
Change in state requires a redraw, however drawing when getting `Occluded` with vsync will block indefinitely, thus the event in it's current state is rather useless. To solve this issue winit needs a way to determine whether the user paused/continued their render loop, so it can commit on their behalf. This commit also forces redraw when getting configure. Links: https://github.com/rust-windowing/winit/issues/3442
This commit is contained in:
parent
f526a47152
commit
ff731197dc
4 changed files with 16 additions and 24 deletions
|
|
@ -296,12 +296,19 @@ impl WindowHandler for WinitState {
|
|||
.expect("got configure for dead window.")
|
||||
.lock()
|
||||
.unwrap()
|
||||
.configure(
|
||||
configure,
|
||||
&self.shm,
|
||||
&self.subcompositor_state,
|
||||
&mut self.events_sink,
|
||||
);
|
||||
.configure(configure, &self.shm, &self.subcompositor_state);
|
||||
|
||||
// NOTE: configure demands wl_surface::commit, however winit doesn't commit on behalf of the
|
||||
// users, since it can break a lot of things, thus it'll ask users to redraw instead.
|
||||
self.window_requests
|
||||
.get_mut()
|
||||
.get(&window_id)
|
||||
.unwrap()
|
||||
.redraw_requested
|
||||
.store(true, Ordering::Relaxed);
|
||||
|
||||
// Manually mark that we've got an event, since configure may not generate a resize.
|
||||
self.dispatched_events = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue