aboutsummaryrefslogtreecommitdiff
path: root/src/layout/scrolling.rs
diff options
context:
space:
mode:
authorsashomasho <sashomasho@gmail.com>2025-06-11 09:05:14 +0300
committerGitHub <noreply@github.com>2025-06-11 06:05:14 +0000
commit8d7b22d1a8968a46286fdd13ca9d8d2c88e10e48 (patch)
treed146f59c630f6a74141f0f691e89b3e87fc0138f /src/layout/scrolling.rs
parent0407ac5e4ce67255388d7ed8d85ffdbe14ec99ab (diff)
downloadniri-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/scrolling.rs')
-rw-r--r--src/layout/scrolling.rs11
1 files changed, 7 insertions, 4 deletions
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<W: LayoutElement> ScrollingSpace<W> {
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<W: LayoutElement> ScrollingSpace<W> {
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);