fix(wm): handle monocled stack cycle commands

This commit is contained in:
alex-ds13
2024-10-21 18:34:22 +01:00
committed by LGUG2Z
parent d194afe6e6
commit 73d928771d

View File

@@ -1870,7 +1870,12 @@ impl WindowManager {
tracing::info!("cycling container windows");
let container = self.focused_container_mut()?;
let container =
if let Some(container) = self.focused_workspace_mut()?.monocle_container_mut() {
container
} else {
self.focused_container_mut()?
};
let len = NonZeroUsize::new(container.windows().len())
.ok_or_else(|| anyhow!("there must be at least one window in a container"))?;
@@ -1894,7 +1899,12 @@ impl WindowManager {
tracing::info!("focusing container window at index {idx}");
let container = self.focused_container_mut()?;
let container =
if let Some(container) = self.focused_workspace_mut()?.monocle_container_mut() {
container
} else {
self.focused_container_mut()?
};
let len = NonZeroUsize::new(container.windows().len())
.ok_or_else(|| anyhow!("there must be at least one window in a container"))?;