Skip to content

Commit

Permalink
chore: add init finished check
Browse files Browse the repository at this point in the history
  • Loading branch information
Decodetalkers committed Oct 5, 2024
1 parent a1f2e00 commit a4ba705
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion layershellev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ pub struct WindowState<T> {
xdg_info_cache: Vec<(wl_output::WlOutput, ZxdgOutputInfo)>,

start_mode: StartMode,
init_finished: bool,
}

impl<T> WindowState<T> {
Expand Down Expand Up @@ -940,6 +941,7 @@ impl<T> Default for WindowState<T> {
xdg_info_cache: Vec::new(),

start_mode: StartMode::Single,
init_finished: false,
}
}
}
Expand Down Expand Up @@ -1563,7 +1565,7 @@ impl<T> Dispatch<zxdg_output_v1::ZxdgOutputV1, ()> for WindowState<T> {
_conn: &Connection,
_qhandle: &QueueHandle<Self>,
) {
if state.is_with_target() {
if state.is_with_target() && !state.init_finished {
let Some((_, xdg_info)) = state
.xdg_info_cache
.iter_mut()
Expand Down Expand Up @@ -1864,6 +1866,7 @@ impl<T: 'static> WindowState<T> {
}
self.message.clear();
}
self.init_finished = true;
self.event_queue = Some(event_queue);
self.globals = Some(globals);
self.wl_compositor = Some(wmcompositer);
Expand Down

0 comments on commit a4ba705

Please sign in to comment.