Add strict-new-window-focus-policy debug flag

This commit is contained in:
Ivan Molodetskikh
2024-11-29 11:37:33 +03:00
parent 305fc3b557
commit 8b84afbd38
3 changed files with 24 additions and 1 deletions
+2
View File
@@ -1537,6 +1537,8 @@ pub struct DebugConfig {
pub keep_laptop_panel_on_when_lid_is_closed: bool,
#[knuffel(child)]
pub disable_monitor_names: bool,
#[knuffel(child)]
pub strict_new_window_focus_policy: bool,
}
#[derive(knuffel::DecodeScalar, Debug, Clone, Copy, PartialEq, Eq)]
+8 -1
View File
@@ -145,7 +145,14 @@ impl CompositorHandler for State {
.filter(|token| token.timestamp.elapsed() < XDG_ACTIVATION_TOKEN_TIMEOUT)
{
Some(_) => ActivateWindow::Yes,
None => ActivateWindow::Smart,
None => {
let config = self.niri.config.borrow();
if config.debug.strict_new_window_focus_policy {
ActivateWindow::No
} else {
ActivateWindow::Smart
}
}
};
let output = if let Some(p) = parent {
+14
View File
@@ -24,6 +24,7 @@ debug {
disable-transactions
keep-laptop-panel-on-when-lid-is-closed
disable-monitor-names
strict-new-window-focus-policy
}
binds {
@@ -194,6 +195,19 @@ debug {
}
```
### `strict-new-window-focus-policy`
<sup>Since: 0.1.11</sup>
Disables heuristic automatic focusing for new windows.
Only windows that activate themselves with a valid xdg-activation token will be focused.
```kdl
debug {
strict-new-window-focus-policy
}
```
### Key Bindings
These are not debug options, but rather key bindings.