diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-12-28 09:09:28 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-12-28 09:09:28 +0400 |
| commit | f3e5e13c4503978d47934fb4828bb12fbe606220 (patch) | |
| tree | f4d4a99499c2705b2fb704b66585e2c7cae3545e /src/layout/mod.rs | |
| parent | b13892ca637cccfb496e3204b2793c069af17ccb (diff) | |
| download | niri-f3e5e13c4503978d47934fb4828bb12fbe606220.tar.gz niri-f3e5e13c4503978d47934fb4828bb12fbe606220.tar.bz2 niri-f3e5e13c4503978d47934fb4828bb12fbe606220.zip | |
Activate windows only on active monitors
This matches what we do in advance_animations().
Diffstat (limited to 'src/layout/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 13 |
1 files changed, 9 insertions, 4 deletions
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<Window> { 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); } } } |
