mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-16 22:01:22 +01:00
feat(wm): add targeted container lock socket messages
This commit migrates the LockMonitorWorkspaceContainer and UnlockMonitorWorkspaceContainer SocketMessage variants, which if I'm remembering correctly were implemented to help with functionality on the komorebi-bar.
This commit is contained in:
1 parent
20c3bbd9a1
commit
e1be883dab
2 files changed
+39
-2
No files matched your search
@@ -253,8 +253,8 @@ pub enum SocketMessage {
|
||||
PromoteFocus,
|
||||
PromoteWindow(OperationDirection),
|
||||
EagerFocus(String),
|
||||
// LockMonitorWorkspaceContainer(usize, usize, usize),
|
||||
// UnlockMonitorWorkspaceContainer(usize, usize, usize),
|
||||
LockMonitorWorkspaceContainer(usize, usize, usize),
|
||||
UnlockMonitorWorkspaceContainer(usize, usize, usize),
|
||||
ToggleLock,
|
||||
ToggleFloat,
|
||||
ToggleMonocle,
|
||||
|
||||
@@ -240,7 +240,44 @@ impl WindowManager {
|
||||
}
|
||||
self.focus_container_window(idx)?;
|
||||
}
|
||||
SocketMessage::LockMonitorWorkspaceContainer(
|
||||
monitor_idx,
|
||||
workspace_idx,
|
||||
container_idx,
|
||||
) => {
|
||||
let monitor = self
|
||||
.monitors_mut()
|
||||
.get_mut(monitor_idx)
|
||||
.ok_or_eyre("no monitor at the given index")?;
|
||||
|
||||
let workspace = monitor
|
||||
.workspaces_mut()
|
||||
.get_mut(workspace_idx)
|
||||
.ok_or_eyre("no workspace at the given index")?;
|
||||
|
||||
if let Some(container) = workspace.containers_mut().get_mut(container_idx) {
|
||||
container.locked = true;
|
||||
}
|
||||
}
|
||||
SocketMessage::UnlockMonitorWorkspaceContainer(
|
||||
monitor_idx,
|
||||
workspace_idx,
|
||||
container_idx,
|
||||
) => {
|
||||
let monitor = self
|
||||
.monitors_mut()
|
||||
.get_mut(monitor_idx)
|
||||
.ok_or_eyre("no monitor at the given index")?;
|
||||
|
||||
let workspace = monitor
|
||||
.workspaces_mut()
|
||||
.get_mut(workspace_idx)
|
||||
.ok_or_eyre("no workspace at the given index")?;
|
||||
|
||||
if let Some(container) = workspace.containers_mut().get_mut(container_idx) {
|
||||
container.locked = false;
|
||||
}
|
||||
}
|
||||
SocketMessage::FlipLayout(layout_flip) => self.flip_layout(layout_flip)?,
|
||||
SocketMessage::ChangeLayout(layout) => self.change_workspace_layout_default(layout)?,
|
||||
SocketMessage::CycleLayout(direction) => self.cycle_layout(direction)?,
|
||||
|
||||
Reference in new issue
Block a user