diff --git a/layershellev/src/lib.rs b/layershellev/src/lib.rs index 24e34c1..854e344 100644 --- a/layershellev/src/lib.rs +++ b/layershellev/src/lib.rs @@ -591,6 +591,7 @@ pub struct WindowState { xdg_info_cache: Vec<(wl_output::WlOutput, ZxdgOutputInfo)>, start_mode: StartMode, + init_finished: bool, } impl WindowState { @@ -940,6 +941,7 @@ impl Default for WindowState { xdg_info_cache: Vec::new(), start_mode: StartMode::Single, + init_finished: false, } } } @@ -1563,7 +1565,7 @@ impl Dispatch for WindowState { _conn: &Connection, _qhandle: &QueueHandle, ) { - if state.is_with_target() { + if state.is_with_target() && !state.init_finished { let Some((_, xdg_info)) = state .xdg_info_cache .iter_mut() @@ -1864,6 +1866,7 @@ impl WindowState { } self.message.clear(); } + self.init_finished = true; self.event_queue = Some(event_queue); self.globals = Some(globals); self.wl_compositor = Some(wmcompositer);