fix(wm): disallow toggle-float if ws has a monocle container

This commit ensures that the user can't get into a weird state by
attempting to float a monocle container. If a user attempts to call
toggle-float on a monocle container, a warning will be logged and the
command will be ignored.
This commit is contained in:
LGUG2Z
2025-05-15 08:09:08 -07:00
parent 6a10d583a6
commit 6f1d6dbdc7

View File

@@ -3131,6 +3131,10 @@ impl WindowManager {
pub fn toggle_float(&mut self, force_float: bool) -> Result<()> {
let hwnd = WindowsApi::foreground_window()?;
let workspace = self.focused_workspace_mut()?;
if workspace.monocle_container().is_some() {
tracing::warn!("ignoring toggle-float command while workspace has a monocle container");
return Ok(());
}
let mut is_floating_window = false;