diff options
| author | nyx <nnyyxxxx@protonmail.com> | 2025-03-29 02:40:08 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-29 06:40:08 +0000 |
| commit | 0db48e2f1bf001bfd05c686002ff1998d0f1205b (patch) | |
| tree | afc86c3f1652675750f3c6d0db0c6e0d932d4438 /src/layout/mod.rs | |
| parent | 7cfecf4b1b9b8c11c80061fb31926f888228499d (diff) | |
| download | niri-0db48e2f1bf001bfd05c686002ff1998d0f1205b.tar.gz niri-0db48e2f1bf001bfd05c686002ff1998d0f1205b.tar.bz2 niri-0db48e2f1bf001bfd05c686002ff1998d0f1205b.zip | |
Add focus argument to move-window-to-workspace (#1332)
* layout: add focus flag to move-window-to-workspace
* lib: update comment
* misc: minor dup refactor
* input: format code
* layout: minor nit
* layout: update comment
* input: remove unnecessary conditionals
* misc: replace boolean
* tests: fix the failing one
* layout: change to smart
* ipc: Option<bool> -> bool
* lib: format code
* Rewrite focus doc comment
---------
Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
Diffstat (limited to 'src/layout/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 64e6877c..62ece8c0 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -2120,7 +2120,12 @@ impl<W: LayoutElement> Layout<W> { monitor.move_to_workspace_down(); } - pub fn move_to_workspace(&mut self, window: Option<&W::Id>, idx: usize) { + pub fn move_to_workspace( + &mut self, + window: Option<&W::Id>, + idx: usize, + activate: ActivateWindow, + ) { if let Some(InteractiveMoveState::Moving(move_)) = &mut self.interactive_move { if window.is_none() || window == Some(move_.tile.window().id()) { return; @@ -2143,7 +2148,7 @@ impl<W: LayoutElement> Layout<W> { }; monitor }; - monitor.move_to_workspace(window, idx); + monitor.move_to_workspace(window, idx, activate); } pub fn move_column_to_workspace_up(&mut self) { |
