aboutsummaryrefslogtreecommitdiff
path: root/niri-config/src
diff options
context:
space:
mode:
authorKirottu <56396750+Kirottu@users.noreply.github.com>2025-01-25 10:49:51 +0200
committerGitHub <noreply@github.com>2025-01-25 08:49:51 +0000
commit852da5714affd067de731599136ed619dc3bba40 (patch)
treee42514f81d8a7f74f5437746503367082917777a /niri-config/src
parent4f793038117b4fef38f491e665a66589eb896e0a (diff)
downloadniri-852da5714affd067de731599136ed619dc3bba40.tar.gz
niri-852da5714affd067de731599136ed619dc3bba40.tar.bz2
niri-852da5714affd067de731599136ed619dc3bba40.zip
Add move-workspace-to-index and move-workspace-to-monitor actions (#1007)
* Added move-workspace-to-index and move-workspace-to-monitor IPC actions * Added redraws to the workspace handling actions, fixed tests that panicked, fixed other mentioned problems. * Fixed workspace focusing and handling numbered workspaces with `move-workspace-to-index` * Fixed more inconsistencies with move-workspace-to-monitor * Added back `self.workspace_switch = None` * Reordered some workspace cleanup logic * Fix formatting * Add missing blank lines * Fix moving workspace to same monitor and wrong current index updating * Move function up and add fixme comment --------- Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
Diffstat (limited to 'niri-config/src')
-rw-r--r--niri-config/src/lib.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs
index 62c91b34..b70499d1 100644
--- a/niri-config/src/lib.rs
+++ b/niri-config/src/lib.rs
@@ -1358,6 +1358,18 @@ pub enum Action {
MoveColumnToWorkspace(#[knuffel(argument)] WorkspaceReference),
MoveWorkspaceDown,
MoveWorkspaceUp,
+ MoveWorkspaceToIndex(#[knuffel(argument)] usize),
+ #[knuffel(skip)]
+ MoveWorkspaceToIndexByRef {
+ new_idx: usize,
+ reference: WorkspaceReference,
+ },
+ #[knuffel(skip)]
+ MoveWorkspaceToMonitorByRef {
+ output_name: String,
+ reference: WorkspaceReference,
+ },
+ MoveWorkspaceToMonitor(#[knuffel(argument)] String),
SetWorkspaceName(#[knuffel(argument)] String),
#[knuffel(skip)]
SetWorkspaceNameByRef {
@@ -1612,6 +1624,28 @@ impl From<niri_ipc::Action> for Action {
niri_ipc::Action::MoveWorkspaceToMonitorPrevious {} => {
Self::MoveWorkspaceToMonitorPrevious
}
+ niri_ipc::Action::MoveWorkspaceToIndex {
+ index,
+ reference: Some(reference),
+ } => Self::MoveWorkspaceToIndexByRef {
+ new_idx: index,
+ reference: WorkspaceReference::from(reference),
+ },
+ niri_ipc::Action::MoveWorkspaceToIndex {
+ index,
+ reference: None,
+ } => Self::MoveWorkspaceToIndex(index),
+ niri_ipc::Action::MoveWorkspaceToMonitor {
+ output,
+ reference: Some(reference),
+ } => Self::MoveWorkspaceToMonitorByRef {
+ output_name: output,
+ reference: WorkspaceReference::from(reference),
+ },
+ niri_ipc::Action::MoveWorkspaceToMonitor {
+ output,
+ reference: None,
+ } => Self::MoveWorkspaceToMonitor(output),
niri_ipc::Action::MoveWorkspaceToMonitorNext {} => Self::MoveWorkspaceToMonitorNext,
niri_ipc::Action::ToggleDebugTint {} => Self::ToggleDebugTint,
niri_ipc::Action::DebugToggleOpaqueRegions {} => Self::DebugToggleOpaqueRegions,