Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/wiki/Configuration:-Recent-Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ recent-windows {
Mod+grave { next-window filter="app-id"; }
Mod+Shift+grave { previous-window filter="app-id"; }
}

// disable-mouse
}
```

Expand Down Expand Up @@ -191,3 +193,10 @@ For example, if you have <kbd>Mod</kbd><kbd>Shift</kbd><kbd>C</kbd> bound to `cl

This way we don't need to hardcode things like HJKL directional movements.
If you have, say, Colemak-DH MNEI binds instead, they will work for you in the window switcher (as long as they don't conflict with the hardcoded ones).

### disable-mouse

<sup>Since: next release</sup>

This setting lets you disable your mouse from interacting with the window switcher.
This option might be useful if you have a graphic tablet, and the pointer messes with the switcher
10 changes: 10 additions & 0 deletions niri-config/src/recent_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub struct RecentWindows {
pub highlight: MruHighlight,
pub previews: MruPreviews,
pub binds: Vec<Bind>,
pub enable_mouse: bool,
}

impl Default for RecentWindows {
Expand All @@ -25,6 +26,7 @@ impl Default for RecentWindows {
highlight: MruHighlight::default(),
previews: MruPreviews::default(),
binds: default_binds(),
enable_mouse: true
}
}
}
Expand All @@ -45,6 +47,10 @@ pub struct RecentWindowsPart {
pub previews: Option<MruPreviewsPart>,
#[knuffel(child)]
pub binds: Option<MruBinds>,
#[knuffel(child)]
pub enable_mouse: bool,
#[knuffel(child)]
pub disable_mouse: bool,
}

impl MergeWith<RecentWindowsPart> for RecentWindows {
Expand All @@ -53,6 +59,10 @@ impl MergeWith<RecentWindowsPart> for RecentWindows {
if part.off {
self.on = false;
}
self.enable_mouse |= part.enable_mouse;
if part.disable_mouse {
self.enable_mouse = false;
}

merge_clone!((self, part), debounce_ms, open_delay_ms);
merge!((self, part), highlight, previews);
Expand Down
5 changes: 5 additions & 0 deletions src/ui/mru.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,11 @@ impl WindowMruUi {
let UiState::Open(inner) = &mut self.state else {
return None;
};

if !inner.config.borrow().recent_windows.enable_mouse{
return None;
}

// Don't handle pointer until the UI is visible.
if !inner.is_fully_open() {
return None;
Expand Down