From 82c7d6504953c0d19ba3d0458fbcfaa8800b56df Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Wed, 13 Sep 2023 12:51:41 +0200 Subject: [PATCH] tiling: Only render swap-preview on active output --- src/shell/layout/tiling/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/shell/layout/tiling/mod.rs b/src/shell/layout/tiling/mod.rs index 2f734ef9..21d574b5 100644 --- a/src/shell/layout/tiling/mod.rs +++ b/src/shell/layout/tiling/mod.rs @@ -4711,6 +4711,9 @@ where }) }) .map(|(id, _)| id); + let is_active_output = seat + .map(|seat| &seat.active_output() == output) + .unwrap_or(false); let mut animating_window_elements = Vec::new(); let mut window_elements = Vec::new(); @@ -4725,7 +4728,8 @@ where let output_scale = output.current_scale().fractional_scale(); let (swap_indicator, swap_tree) = overview.1.unzip(); - let swap_tree = swap_tree.flatten(); + let swap_tree = swap_tree.flatten().filter(|_| is_active_output); + let swap_desc = swap_desc.filter(|_| is_active_output); if target_tree.root_node_id().is_none() && swap_desc.is_some() { let mut geo = non_exclusive_zone;