From 73d928771dbb9a536046aad91982fa2560b19dde Mon Sep 17 00:00:00 2001 From: alex-ds13 <145657253+alex-ds13@users.noreply.github.com> Date: Mon, 21 Oct 2024 18:34:22 +0100 Subject: [PATCH] fix(wm): handle monocled stack cycle commands --- komorebi/src/window_manager.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/komorebi/src/window_manager.rs b/komorebi/src/window_manager.rs index f5e38139..1080e5fa 100644 --- a/komorebi/src/window_manager.rs +++ b/komorebi/src/window_manager.rs @@ -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"))?;