From 0db48e2f1bf001bfd05c686002ff1998d0f1205b Mon Sep 17 00:00:00 2001 From: nyx Date: Sat, 29 Mar 2025 02:40:08 -0400 Subject: 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 * lib: format code * Rewrite focus doc comment --------- Co-authored-by: Ivan Molodetskikh --- src/layout/mod.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/layout/mod.rs') 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 Layout { 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 Layout { }; monitor }; - monitor.move_to_workspace(window, idx); + monitor.move_to_workspace(window, idx, activate); } pub fn move_column_to_workspace_up(&mut self) { -- cgit