Respect initial configure

This commit is contained in:
Ottatop 2023-08-31 20:42:58 -05:00
parent 39d5454a7f
commit 5744654cb1

View file

@ -92,9 +92,29 @@ impl XdgShellHandler for State {
// TODO: fix it so that reordering this doesn't break stuff // TODO: fix it so that reordering this doesn't break stuff
self.windows.push(window.clone()); self.windows.push(window.clone());
if let Some(focused_output) = self.focus_state.focused_output.clone() { let win_clone = window.clone();
// FIXME: ignoring initial configure here self.schedule(
self.update_windows(&focused_output); move |_data| {
if let WindowElement::Wayland(window) = &win_clone {
let initial_configure_sent =
compositor::with_states(window.toplevel().wl_surface(), |states| {
states
.data_map
.get::<smithay::wayland::shell::xdg::XdgToplevelSurfaceData>()
.expect("XdgToplevelSurfaceData wasn't in surface's data map")
.lock()
.expect("Failed to lock Mutex<XdgToplevelSurfaceData>")
.initial_configure_sent
});
initial_configure_sent
} else {
true
}
},
|data| {
if let Some(focused_output) = data.state.focus_state.focused_output.clone() {
data.state.update_windows(&focused_output);
BLOCKER_COUNTER.store(1, std::sync::atomic::Ordering::SeqCst); BLOCKER_COUNTER.store(1, std::sync::atomic::Ordering::SeqCst);
tracing::debug!( tracing::debug!(
"blocker {}", "blocker {}",
@ -106,7 +126,7 @@ impl XdgShellHandler for State {
} }
} }
let clone = window.clone(); let clone = window.clone();
self.loop_handle.insert_idle(|data| { data.state.loop_handle.insert_idle(|data| {
crate::state::schedule_on_commit(data, vec![clone], move |data| { crate::state::schedule_on_commit(data, vec![clone], move |data| {
BLOCKER_COUNTER.store(0, std::sync::atomic::Ordering::SeqCst); BLOCKER_COUNTER.store(0, std::sync::atomic::Ordering::SeqCst);
tracing::debug!( tracing::debug!(
@ -124,7 +144,7 @@ impl XdgShellHandler for State {
}) })
}); });
} }
self.loop_handle.insert_idle(move |data| { data.state.loop_handle.insert_idle(move |data| {
data.state data.state
.seat .seat
.get_keyboard() .get_keyboard()
@ -135,6 +155,8 @@ impl XdgShellHandler for State {
SERIAL_COUNTER.next_serial(), SERIAL_COUNTER.next_serial(),
); );
}); });
},
);
} }
fn toplevel_destroyed(&mut self, surface: ToplevelSurface) { fn toplevel_destroyed(&mut self, surface: ToplevelSurface) {