From a4ba70504db78251a6f087b282a7097108f94af1 Mon Sep 17 00:00:00 2001 From: ShootingStarDragons Date: Sat, 5 Oct 2024 12:59:03 +0900 Subject: [PATCH] chore: add init finished check --- layershellev/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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);