anvil: Skip decoration configure before initial
@@ -51,7 +51,7 @@ use smithay::{
wlr_layer::WlrLayerShellState,
xdg::{
decoration::{XdgDecorationHandler, XdgDecorationState},
- ToplevelSurface, XdgShellState,
+ ToplevelSurface, XdgShellState, XdgToplevelSurfaceData,
},
},
shm::{ShmHandler, ShmState},
@@ -291,9 +291,21 @@ impl<BackendData: Backend> XdgDecorationHandler for AnvilState<BackendData> {
}
});
});
+
+ let initial_configure_sent = with_states(toplevel.wl_surface(), |states| {
+ states
+ .data_map
+ .get::<XdgToplevelSurfaceData>()
+ .unwrap()
+ .lock()
+ .unwrap()
+ .initial_configure_sent
+ });
+ if initial_configure_sent {
toplevel.send_configure();
}
}
+ }
fn unset_mode(&mut self, toplevel: ToplevelSurface) {
use xdg_decoration::zv1::server::zxdg_toplevel_decoration_v1::Mode;
if let Some(w) = self
@@ -305,10 +317,21 @@ impl<BackendData: Backend> XdgDecorationHandler for AnvilState<BackendData> {
toplevel.with_pending_state(|state| {
state.decoration_mode = Some(Mode::ClientSide);
});
+ let initial_configure_sent = with_states(toplevel.wl_surface(), |states| {
+ states
+ .data_map
+ .get::<XdgToplevelSurfaceData>()
+ .unwrap()
+ .lock()
+ .unwrap()
+ .initial_configure_sent
+ });
+ if initial_configure_sent {
toplevel.send_configure();
}
}
}
+}
delegate_xdg_decoration!(@<BackendData: Backend + 'static> AnvilState<BackendData>);
delegate_xdg_shell!(@<BackendData: Backend + 'static> AnvilState<BackendData>);
