diff options
| author | sashomasho <sashomasho@gmail.com> | 2025-06-11 09:05:14 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-11 06:05:14 +0000 |
| commit | 8d7b22d1a8968a46286fdd13ca9d8d2c88e10e48 (patch) | |
| tree | d146f59c630f6a74141f0f691e89b3e87fc0138f /src/layout/floating.rs | |
| parent | 0407ac5e4ce67255388d7ed8d85ffdbe14ec99ab (diff) | |
| download | niri-8d7b22d1a8968a46286fdd13ca9d8d2c88e10e48.tar.gz niri-8d7b22d1a8968a46286fdd13ca9d8d2c88e10e48.tar.bz2 niri-8d7b22d1a8968a46286fdd13ca9d8d2c88e10e48.zip | |
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 <sashomasho@gmail.com>
* fixes
---------
Signed-off-by: Alex Yosifov <sashomasho@gmail.com>
Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
Diffstat (limited to 'src/layout/floating.rs')
| -rw-r--r-- | src/layout/floating.rs | 7 |
1 files changed, 5 insertions, 2 deletions
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<W: LayoutElement> FloatingSpace<W> { 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<W: LayoutElement> FloatingSpace<W> { 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 |
