From cf357d7058910864018c3e3702a9723194fce916 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Thu, 22 Aug 2024 14:36:47 +0300 Subject: Implement window resize throttling --- src/layout/workspace.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/layout/workspace.rs') diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs index 85ba7b46..8f0ae6e3 100644 --- a/src/layout/workspace.rs +++ b/src/layout/workspace.rs @@ -15,7 +15,7 @@ use smithay::utils::{Logical, Point, Rectangle, Scale, Serial, Size, Transform}; use super::closing_window::{ClosingWindow, ClosingWindowRenderElement}; use super::tile::{Tile, TileRenderElement}; -use super::{InteractiveResizeData, LayoutElement, Options}; +use super::{ConfigureIntent, InteractiveResizeData, LayoutElement, Options}; use crate::animation::Animation; use crate::input::swipe_tracker::SwipeTracker; use crate::niri_render_elements; @@ -2759,7 +2759,15 @@ impl Workspace { ); win.set_bounds(bounds); - win.send_pending_configure(); + let intent = win.configure_intent(); + + if matches!( + intent, + ConfigureIntent::CanSend | ConfigureIntent::ShouldSend + ) { + win.send_pending_configure(); + } + win.refresh(); } } -- cgit