From 8d7b22d1a8968a46286fdd13ca9d8d2c88e10e48 Mon Sep 17 00:00:00 2001 From: sashomasho Date: Wed, 11 Jun 2025 09:05:14 +0300 Subject: Add deactivate-unfocused-windows debug flag (#1706) * force xdg deactivation on invisable workspaces This debug option provides a workaround for many Chromium-based chat applications that fail to show notifications when they're active in a workspace that's not currently visible and don't have keyboard focus Signed-off-by: Alex Yosifov * fixes --------- Signed-off-by: Alex Yosifov Co-authored-by: Ivan Molodetskikh --- src/layout/scrolling.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/layout/scrolling.rs') diff --git a/src/layout/scrolling.rs b/src/layout/scrolling.rs index 1b4d91c5..0c70fc7a 100644 --- a/src/layout/scrolling.rs +++ b/src/layout/scrolling.rs @@ -3458,7 +3458,7 @@ impl ScrollingSpace { self.interactive_resize = None; } - pub fn refresh(&mut self, is_active: bool) { + pub fn refresh(&mut self, is_active: bool, is_focused: bool) { for (col_idx, col) in self.columns.iter_mut().enumerate() { let mut col_resize_data = None; if let Some(resize) = &self.interactive_resize { @@ -3503,11 +3503,14 @@ impl ScrollingSpace { win.set_active_in_column(active_in_column); win.set_floating(false); - let active = is_active - && self.active_column_idx == col_idx + let mut active = is_active && self.active_column_idx == col_idx; + if self.options.deactivate_unfocused_windows { + active &= active_in_column && is_focused; + } else { // In tabbed mode, all tabs have activated state to reduce unnecessary // animations when switching tabs. - && (active_in_column || is_tabbed); + active &= active_in_column || is_tabbed; + } win.set_activated(active); win.set_interactive_resize(col_resize_data); -- cgit