mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
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>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user