Skip to content

Commit

Permalink
fix(cli): respect named ws send behaviour
Browse files Browse the repository at this point in the history
This commit ensures that the "send" behaviour is respected in
named-workspace command variants such as send-to-named-workspace.
  • Loading branch information
LGUG2Z committed May 30, 2024
1 parent 6c90001 commit 2703744
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions komorebi/src/window_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)?;
}
Expand Down

0 comments on commit 2703744

Please sign in to comment.