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/mod.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/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 9b0002e0..5deda707 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -361,6 +361,7 @@ pub struct Options { // Debug flags. pub disable_resize_throttling: bool, pub disable_transactions: bool, + pub deactivate_unfocused_windows: bool, } impl Default for Options { @@ -393,6 +394,7 @@ impl Default for Options { PresetSize::Proportion(0.5), PresetSize::Proportion(2. / 3.), ], + deactivate_unfocused_windows: false, } } } @@ -658,6 +660,7 @@ impl Options { overview: config.overview, disable_resize_throttling: config.debug.disable_resize_throttling, disable_transactions: config.debug.disable_transactions, + deactivate_unfocused_windows: config.debug.deactivate_unfocused_windows, preset_window_heights, } } @@ -5124,7 +5127,8 @@ impl<W: LayoutElement> Layout<W> { } for (ws_idx, ws) in mon.workspaces.iter_mut().enumerate() { - ws.refresh(is_active); + let is_focused = is_active && ws_idx == mon.active_workspace_idx; + ws.refresh(is_active, is_focused); if let Some(is_scrolling) = ongoing_scrolling_dnd { // Lock or unlock the view for scrolling interactive move. @@ -5144,7 +5148,7 @@ impl<W: LayoutElement> Layout<W> { } MonitorSet::NoOutputs { workspaces, .. } => { for ws in workspaces { - ws.refresh(false); + ws.refresh(false, false); ws.view_offset_gesture_end(None); } } |
