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 --- niri-ipc/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'niri-ipc') diff --git a/niri-ipc/src/lib.rs b/niri-ipc/src/lib.rs index 591c1bf6..fb90dbe7 100644 --- a/niri-ipc/src/lib.rs +++ b/niri-ipc/src/lib.rs @@ -426,6 +426,14 @@ pub enum Action { /// Reference (index or name) of the workspace to move the window to. #[cfg_attr(feature = "clap", arg())] reference: WorkspaceReferenceArg, + + /// Whether the focus should follow the moved window. + /// + /// If `true` (the default) and the window to move is focused, the focus will follow the + /// window to the new workspace. If `false`, the focus will remain on the original + /// workspace. + #[cfg_attr(feature = "clap", arg(long, action = clap::ArgAction::Set, default_value_t = true))] + focus: bool, }, /// Move the focused column to the workspace below. MoveColumnToWorkspaceDown {}, -- cgit