Skip to content

Commit

Permalink
toplevel_info: Don't send geometry updates, while resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
Drakulix committed Jan 16, 2025
1 parent 75661c6 commit 3952887
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/wayland/handlers/toplevel_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>> {
Expand Down
13 changes: 8 additions & 5 deletions src/wayland/protocols/toplevel_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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()) {
Expand Down

0 comments on commit 3952887

Please sign in to comment.