Skip to content

Commit 3952887

Browse files
committed
toplevel_info: Don't send geometry updates, while resizing
1 parent 75661c6 commit 3952887

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/wayland/handlers/toplevel_info.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ impl Window for CosmicSurface {
4848
}
4949

5050
fn is_sticky(&self) -> bool {
51-
CosmicSurface::is_sticky(&self)
51+
CosmicSurface::is_sticky(self)
52+
}
53+
54+
fn is_resizing(&self) -> bool {
55+
CosmicSurface::is_resizing(self, true).unwrap_or(false)
5256
}
5357

5458
fn global_geometry(&self) -> Option<Rectangle<i32, Global>> {

src/wayland/protocols/toplevel_info.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ pub trait Window: IsAlive + Clone + PartialEq + Send {
3333
fn is_fullscreen(&self) -> bool;
3434
fn is_minimized(&self) -> bool;
3535
fn is_sticky(&self) -> bool;
36+
fn is_resizing(&self) -> bool;
3637
fn global_geometry(&self) -> Option<Rectangle<i32, Global>>;
3738
fn user_data(&self) -> &UserDataMap;
3839
}
@@ -536,12 +537,14 @@ where
536537
changed = true;
537538
}
538539

539-
let geometry = window.global_geometry();
540540
let mut geometry_changed = false;
541-
if handle_state.geometry != geometry {
542-
handle_state.geometry = geometry;
543-
changed = true;
544-
geometry_changed = true;
541+
if !window.is_resizing() {
542+
let geometry = window.global_geometry();
543+
if handle_state.geometry != geometry {
544+
handle_state.geometry = geometry;
545+
changed = true;
546+
geometry_changed = true;
547+
}
545548
}
546549

547550
if let Ok(client) = dh.get_client(instance.id()) {

0 commit comments

Comments
 (0)