diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-11-24 08:52:04 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-11-24 08:52:13 +0300 |
| commit | d74debda132dd4b44c045d6d3333d7b586316808 (patch) | |
| tree | a68fbf322703e08d9dbe2636fabe940d5a089d27 /src | |
| parent | 642277f881addc3f375cd81b1f7c78498f4925ad (diff) | |
| download | niri-d74debda132dd4b44c045d6d3333d7b586316808.tar.gz niri-d74debda132dd4b44c045d6d3333d7b586316808.tar.bz2 niri-d74debda132dd4b44c045d6d3333d7b586316808.zip | |
Add debounce-ms recent-windows setting
Diffstat (limited to 'src')
| -rw-r--r-- | src/niri.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/niri.rs b/src/niri.rs index 9520c0bd..e59de48b 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -16,7 +16,7 @@ use calloop::futures::Scheduler; use niri_config::debug::PreviewRender; use niri_config::{ Config, FloatOrInt, Key, Modifiers, OutputName, TrackLayout, WarpMouseToFocusMode, - WorkspaceReference, Xkb, DEFAULT_MRU_COMMIT_MS, + WorkspaceReference, Xkb, }; use smithay::backend::allocator::Fourcc; use smithay::backend::input::Keycode; @@ -1255,11 +1255,13 @@ impl State { // period has gone by without the focus having elsewhere. let stamp = get_monotonic_time(); - if mapped.get_focus_timestamp().is_none() { + let debounce = self.niri.config.borrow().recent_windows.debounce_ms; + let debounce = Duration::from_millis(u64::from(debounce)); + + if mapped.get_focus_timestamp().is_none() || debounce.is_zero() { mapped.set_focus_timestamp(stamp); } else { - let timer = - Timer::from_duration(Duration::from_millis(DEFAULT_MRU_COMMIT_MS)); + let timer = Timer::from_duration(debounce); let focus_token = self .niri |
