Add debounce-ms recent-windows setting

This commit is contained in:
Ivan Molodetskikh
2025-11-24 08:52:04 +03:00
parent 642277f881
commit d74debda13
4 changed files with 39 additions and 12 deletions
+2 -3
View File
@@ -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 {
+5 -5
View File
@@ -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 {