toplevel_info: Don't send geometry updates, while resizing

This commit is contained in:
Victoria Brekenfeld 2025-01-16 16:23:57 +01:00 committed by Victoria Brekenfeld
parent 75661c6ca7
commit 39528878f8
2 changed files with 13 additions and 6 deletions

View file

@ -48,7 +48,11 @@ impl Window for CosmicSurface {
}
fn is_sticky(&self) -> bool {
CosmicSurface::is_sticky(&self)
CosmicSurface::is_sticky(self)
}
fn is_resizing(&self) -> bool {
CosmicSurface::is_resizing(self, true).unwrap_or(false)
}
fn global_geometry(&self) -> Option<Rectangle<i32, Global>> {

View file

@ -33,6 +33,7 @@ pub trait Window: IsAlive + Clone + PartialEq + Send {
fn is_fullscreen(&self) -> bool;
fn is_minimized(&self) -> bool;
fn is_sticky(&self) -> bool;
fn is_resizing(&self) -> bool;
fn global_geometry(&self) -> Option<Rectangle<i32, Global>>;
fn user_data(&self) -> &UserDataMap;
}
@ -536,12 +537,14 @@ where
changed = true;
}
let geometry = window.global_geometry();
let mut geometry_changed = false;
if handle_state.geometry != geometry {
handle_state.geometry = geometry;
changed = true;
geometry_changed = true;
if !window.is_resizing() {
let geometry = window.global_geometry();
if handle_state.geometry != geometry {
handle_state.geometry = geometry;
changed = true;
geometry_changed = true;
}
}
if let Ok(client) = dh.get_client(instance.id()) {