fix(wm): give focus priority to monocle containers

This commit ensures that monocle containers are given priority when
handling WindowManagerEvent::FocusChange.

This is especially important when switching workspaces to ensure that
the keyboard input focus stays with the monocle container's focused
window when returning to a workspace with a monocle container activated.

fix #219
This commit is contained in:
LGUG2Z
2022-08-28 08:09:08 -07:00
parent e4a8117a94
commit 5006aa9009

View File

@@ -198,8 +198,14 @@ impl WindowManager {
}
}
self.focused_workspace_mut()?
.focus_container_by_window(window.hwnd)?;
if let Some(monocle) = workspace.monocle_container() {
if let Some(window) = monocle.focused_window() {
window.focus(false)?;
}
} else {
self.focused_workspace_mut()?
.focus_container_by_window(window.hwnd)?;
}
}
}
WindowManagerEvent::Show(_, window) | WindowManagerEvent::Manage(window) => {