Restore floating window size before the first buffer

This commit is contained in:
Samuel Onoja committed 2026-10-01 11:36:53 +01:00
1 parent a14f222119
commit 53bad8c672
5 files changed
+162 -11

No files matched your search

+22 -6
View File
@@ -285,11 +285,13 @@ impl XdgDecorationHandler for Ferese {
let mode = self.decoration_mode_for(&toplevel);
toplevel.with_pending_state(|state| state.decoration_mode = Some(mode));
// This must be unconditional: the initial xdg-toplevel configure may
// already contain the same mode before the decoration object exists.
// `send_pending_configure` would then see no state change and omit the
// decoration configure, leaving clients to fall back to CSD.
toplevel.send_configure();
// Wait for the initial surface commit so app-id and saved floating
// size can be included in the first configure. If already configured,
// send unconditionally: the existing toplevel state may have the same
// mode, but the new decoration object still needs its configure event.
if initial_configure_sent(&toplevel) {
toplevel.send_configure();
}
}
fn request_mode(&mut self, toplevel: ToplevelSurface, _mode: Mode) {
@@ -319,7 +321,21 @@ impl Ferese {
fn set_decoration_mode(toplevel: &ToplevelSurface, mode: Mode) {
toplevel.with_pending_state(|state| state.decoration_mode = Some(mode));
toplevel.send_pending_configure();
if initial_configure_sent(toplevel) {
toplevel.send_pending_configure();
}
}
pub(crate) fn initial_configure_sent(toplevel: &ToplevelSurface) -> bool {
with_states(toplevel.wl_surface(), |states| {
states
.data_map
.get::<XdgToplevelSurfaceData>()
.unwrap()
.lock()
.unwrap()
.initial_configure_sent
})
}
pub fn handle_commit(popups: &mut PopupManager, space: &mut Space<Window>, surface: &WlSurface) {