diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-02-05 17:18:21 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-02-05 17:25:51 +0300 |
| commit | c41f93a468c4d04e16f8c89736cc48cd4ab4c623 (patch) | |
| tree | 3f6e8fb315550288b4e293e873b13dbf2d421486 /src/layout/workspace.rs | |
| parent | 900da597e4d3d09ad4c4ddc3ba2abf58c4886ec9 (diff) | |
| download | niri-c41f93a468c4d04e16f8c89736cc48cd4ab4c623.tar.gz niri-c41f93a468c4d04e16f8c89736cc48cd4ab4c623.tar.bz2 niri-c41f93a468c4d04e16f8c89736cc48cd4ab4c623.zip | |
Add focus-window-top/bottom/down-or-top/up-or-bottom actions
Diffstat (limited to 'src/layout/workspace.rs')
| -rw-r--r-- | src/layout/workspace.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs index c4cad666..680e5e4c 100644 --- a/src/layout/workspace.rs +++ b/src/layout/workspace.rs @@ -896,6 +896,34 @@ impl<W: LayoutElement> Workspace<W> { } } + pub fn focus_window_top(&mut self) { + if self.floating_is_active.get() { + self.floating.focus_topmost(); + } else { + self.scrolling.focus_top(); + } + } + + pub fn focus_window_bottom(&mut self) { + if self.floating_is_active.get() { + self.floating.focus_bottommost(); + } else { + self.scrolling.focus_bottom(); + } + } + + pub fn focus_window_down_or_top(&mut self) { + if !self.focus_down() { + self.focus_window_top(); + } + } + + pub fn focus_window_up_or_bottom(&mut self) { + if !self.focus_up() { + self.focus_window_bottom(); + } + } + pub fn move_left(&mut self) -> bool { if self.floating_is_active.get() { self.floating.move_left(); |
