mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-18 06:38:38 +01:00
refactor(kde): the lock and unlock arms call komorebi-core
LockMonitorWorkspaceContainer and UnlockMonitorWorkspaceContainer call komorebi_core::set_container_locked, and WindowManager implements ContainerCommandHost with its own monitors_mut. No behaviour change. Verified: KDE cargo test -p komorebi-linux (lite env): 678 passed, 0 failed. Not run: VM suites.
This commit is contained in:
1 parent
0bf26a6d14
commit
bab5fac915
1 file changed
+20
-30
@@ -1362,40 +1362,24 @@ impl WindowManager {
|
||||
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;
|
||||
}
|
||||
}
|
||||
) => komorebi_core::set_container_locked(
|
||||
self,
|
||||
monitor_idx,
|
||||
workspace_idx,
|
||||
container_idx,
|
||||
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;
|
||||
}
|
||||
}
|
||||
) => komorebi_core::set_container_locked(
|
||||
self,
|
||||
monitor_idx,
|
||||
workspace_idx,
|
||||
container_idx,
|
||||
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)?,
|
||||
@@ -2110,6 +2094,12 @@ impl komorebi_core::MonitorCommandHost for WindowManager {
|
||||
}
|
||||
}
|
||||
|
||||
impl komorebi_core::ContainerCommandHost for WindowManager {
|
||||
fn monitors_mut(&mut self) -> &mut std::collections::VecDeque<crate::monitor::Monitor> {
|
||||
WindowManager::monitors_mut(self)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in new issue
Block a user