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 /niri-config/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 'niri-config/src')
| -rw-r--r-- | niri-config/src/lib.rs | 5 | ||||
| -rw-r--r-- | niri-config/src/recent_windows.rs | 10 |
2 files changed, 7 insertions, 8 deletions
diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs index e458da39..28e54e6b 100644 --- a/niri-config/src/lib.rs +++ b/niri-config/src/lib.rs @@ -56,9 +56,7 @@ pub use crate::layout::*; pub use crate::misc::*; pub use crate::output::{Output, OutputName, Outputs, Position, Vrr}; use crate::recent_windows::RecentWindowsPart; -pub use crate::recent_windows::{ - MruDirection, MruFilter, MruPreviews, MruScope, RecentWindows, DEFAULT_MRU_COMMIT_MS, -}; +pub use crate::recent_windows::{MruDirection, MruFilter, MruPreviews, MruScope, RecentWindows}; pub use crate::utils::FloatOrInt; use crate::utils::{Flag, MergeWith as _}; pub use crate::window_rule::{FloatingPosition, RelativeTo, WindowRule}; @@ -2181,6 +2179,7 @@ mod tests { ], recent_windows: RecentWindows { on: false, + debounce_ms: 750, open_delay_ms: 150, highlight: MruHighlight { active_color: Color { diff --git a/niri-config/src/recent_windows.rs b/niri-config/src/recent_windows.rs index 0d293ba1..46e10f4c 100644 --- a/niri-config/src/recent_windows.rs +++ b/niri-config/src/recent_windows.rs @@ -6,13 +6,10 @@ use smithay::input::keyboard::Keysym; use crate::utils::{expect_only_children, MergeWith}; use crate::{Action, Bind, Color, FloatOrInt, Key, Modifiers, Trigger}; -/// Delay before the window focus is considered to be locked-in for Window -/// MRU ordering. For now the delay is not configurable. -pub const DEFAULT_MRU_COMMIT_MS: u64 = 750; - #[derive(Debug, PartialEq)] pub struct RecentWindows { pub on: bool, + pub debounce_ms: u16, pub open_delay_ms: u16, pub highlight: MruHighlight, pub previews: MruPreviews, @@ -23,6 +20,7 @@ impl Default for RecentWindows { fn default() -> Self { RecentWindows { on: true, + debounce_ms: 750, open_delay_ms: 150, highlight: MruHighlight::default(), previews: MruPreviews::default(), @@ -38,6 +36,8 @@ pub struct RecentWindowsPart { #[knuffel(child)] pub off: bool, #[knuffel(child, unwrap(argument))] + pub debounce_ms: Option<u16>, + #[knuffel(child, unwrap(argument))] pub open_delay_ms: Option<u16>, #[knuffel(child)] pub highlight: Option<MruHighlightPart>, @@ -54,7 +54,7 @@ impl MergeWith<RecentWindowsPart> for RecentWindows { self.on = false; } - merge_clone!((self, part), open_delay_ms); + merge_clone!((self, part), debounce_ms, open_delay_ms); merge!((self, part), highlight, previews); if let Some(part) = &part.binds { |
