mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-21 02:01:55 +07:00
Add strict-new-window-focus-policy debug flag
This commit is contained in:
@@ -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)]
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user