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/floating.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/layout/floating.rs') diff --git a/src/layout/floating.rs b/src/layout/floating.rs index 7d7e7fc0..98927c0d 100644 --- a/src/layout/floating.rs +++ b/src/layout/floating.rs @@ -1090,7 +1090,7 @@ impl FloatingSpace { self.interactive_resize = None; } - pub fn refresh(&mut self, is_active: bool) { + pub fn refresh(&mut self, is_active: bool, is_focused: bool) { let active = self.active_window_id.clone(); for tile in &mut self.tiles { let win = tile.window_mut(); @@ -1098,7 +1098,10 @@ impl FloatingSpace { win.set_active_in_column(true); win.set_floating(true); - let is_active = is_active && Some(win.id()) == active.as_ref(); + let mut is_active = is_active && Some(win.id()) == active.as_ref(); + if self.options.deactivate_unfocused_windows { + is_active &= is_focused; + } win.set_activated(is_active); let resize_data = self -- cgit