From f3e5e13c4503978d47934fb4828bb12fbe606220 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Thu, 28 Dec 2023 09:09:28 +0400 Subject: Activate windows only on active monitors This matches what we do in advance_animations(). --- src/layout/mod.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/layout/mod.rs') diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 1a9b5076..c60211a3 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -1341,16 +1341,21 @@ impl Layout { let _span = tracy_client::span!("MonitorSet::refresh"); match &self.monitor_set { - MonitorSet::Normal { monitors, .. } => { - for mon in monitors { + MonitorSet::Normal { + monitors, + active_monitor_idx, + .. + } => { + for (idx, mon) in monitors.iter().enumerate() { + let is_active = idx == *active_monitor_idx; for ws in &mon.workspaces { - ws.refresh(); + ws.refresh(is_active); } } } MonitorSet::NoOutputs { workspaces, .. } => { for ws in workspaces { - ws.refresh(); + ws.refresh(false); } } } -- cgit