From 3b0830e51165285d7f2b8a0a0ab4b4e00d5c0cbb Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Tue, 6 Dec 2022 18:29:28 -0800 Subject: [PATCH] fix(wm): allow cross-monitor focus w/ monocle+max This commit removes the focused window monocle/maximized check when trying to focus a container in a direction that requires the focus to cross a monitor boundary. Unfortunately, trying to remove the same check from the move command results in undesired behaviour (the wrong window gets moved, the state gets funny on both the origin and the destination monitor) --- komorebi/src/window_manager.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/komorebi/src/window_manager.rs b/komorebi/src/window_manager.rs index 64291473..9cce1071 100644 --- a/komorebi/src/window_manager.rs +++ b/komorebi/src/window_manager.rs @@ -1047,12 +1047,6 @@ impl WindowManager { let workspace = self.focused_workspace()?; - if workspace.is_focused_window_monocle_or_maximized()? { - return Err(anyhow!( - "ignoring command while active window is in monocle mode or maximized" - )); - } - tracing::info!("focusing container"); let new_idx = workspace.new_idx_for_direction(direction); @@ -1082,6 +1076,9 @@ impl WindowManager { self.handle_unmanaged_window_behaviour()?; let workspace = self.focused_workspace()?; + + // removing this messes up the monitor / container / window index somewhere + // and results in the wrong window getting moved across the monitor boundary if workspace.is_focused_window_monocle_or_maximized()? { return Err(anyhow!( "ignoring command while active window is in monocle mode or maximized"