diff --git a/src/shell/element/surface.rs b/src/shell/element/surface.rs index 6fa5bbed..a1b5c5de 100644 --- a/src/shell/element/surface.rs +++ b/src/shell/element/surface.rs @@ -175,6 +175,13 @@ impl CosmicSurface { } } + pub fn has_pending_changes(&self) -> bool { + match self.0.underlying_surface() { + WindowSurface::Wayland(toplevel) => toplevel.has_pending_changes(), + WindowSurface::X11(_surface) => false, + } + } + pub fn global_geometry(&self) -> Option> { *self .0 diff --git a/src/shell/layout/floating/mod.rs b/src/shell/layout/floating/mod.rs index ae29e604..5a440e0d 100644 --- a/src/shell/layout/floating/mod.rs +++ b/src/shell/layout/floating/mod.rs @@ -679,8 +679,10 @@ impl FloatingLayout { mapped_geometry.size = last_size; } } else if !window.is_maximized(true) { - if let Some(pending_size) = window.pending_size() { - mapped_geometry.size = pending_size.as_local(); + if window.active_window().has_pending_changes() { + if let Some(pending_size) = window.pending_size() { + mapped_geometry.size = pending_size.as_local(); + } } *window.last_geometry.lock().unwrap() = Some(mapped_geometry); }