Skip to content

Commit

Permalink
fix(wm): focus workspaces on cross-monitor cmds
Browse files Browse the repository at this point in the history
This commit ensures that if a window is moved to a workspace on another
monitor which is not the currently focused workspace on that monitor,
the target workspace will be focused as part of the operation.
  • Loading branch information
LGUG2Z committed May 7, 2024
1 parent 22cf7b5 commit 627088c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions komorebi/src/window_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,7 @@ impl WindowManager {
let monitor = self
.focused_monitor_mut()
.ok_or_else(|| anyhow!("there is no monitor"))?;

let workspace = monitor
.focused_workspace_mut()
.ok_or_else(|| anyhow!("there is no workspace"))?;
Expand All @@ -1225,6 +1226,11 @@ impl WindowManager {
.ok_or_else(|| anyhow!("there is no monitor"))?;

target_monitor.add_container(container, workspace_idx)?;

if let Some(workspace_idx) = workspace_idx {
target_monitor.focus_workspace(workspace_idx)?;
}

target_monitor.load_focused_workspace(mouse_follows_focus)?;
target_monitor.update_focused_workspace(offset)?;

Expand Down

0 comments on commit 627088c

Please sign in to comment.