From 270374497ca9307ad15f813d9767b067e7a7c68e Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Wed, 29 May 2024 13:10:05 -0700 Subject: [PATCH] fix(cli): respect named ws send behaviour This commit ensures that the "send" behaviour is respected in named-workspace command variants such as send-to-named-workspace. --- komorebi/src/window_manager.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/komorebi/src/window_manager.rs b/komorebi/src/window_manager.rs index cef40c55..f700991b 100644 --- a/komorebi/src/window_manager.rs +++ b/komorebi/src/window_manager.rs @@ -1037,6 +1037,14 @@ impl WindowManager { tracing::info!("moving container"); + let focused_monitor_idx = self.focused_monitor_idx(); + + if focused_monitor_idx == monitor_idx { + if let Some(workspace_idx) = workspace_idx { + return self.move_container_to_workspace(workspace_idx, follow); + } + } + let offset = self.work_area_offset; let mouse_follows_focus = self.mouse_follows_focus; @@ -1072,6 +1080,11 @@ impl WindowManager { target_monitor.load_focused_workspace(mouse_follows_focus)?; target_monitor.update_focused_workspace(offset)?; + // this second one is for DPI changes when the target is another monitor + // if we don't do this the layout on the other monitor could look funny + // until it is interacted with again + target_monitor.update_focused_workspace(offset)?; + if follow { self.focus_monitor(monitor_idx)?; }