mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-05-21 19:26:58 +02:00
feat(wm): auto toggle-monocle on alt-tab
This commit adds a change to automatically toggle monocle mode off on the focused workspace when a window on the same workspace is foregrounded by alt-tab. resolve #834
This commit is contained in:
@@ -334,8 +334,10 @@ impl WindowManager {
|
|||||||
if proceed {
|
if proceed {
|
||||||
let behaviour = self.window_container_behaviour;
|
let behaviour = self.window_container_behaviour;
|
||||||
let workspace = self.focused_workspace_mut()?;
|
let workspace = self.focused_workspace_mut()?;
|
||||||
|
let workspace_contains_window = workspace.contains_window(window.hwnd);
|
||||||
|
let workspace_has_monocle_container = workspace.monocle_container().is_some();
|
||||||
|
|
||||||
if !workspace.contains_window(window.hwnd) && !needs_reconciliation {
|
if !workspace_contains_window && !needs_reconciliation {
|
||||||
match behaviour {
|
match behaviour {
|
||||||
WindowContainerBehaviour::Create => {
|
WindowContainerBehaviour::Create => {
|
||||||
workspace.new_container_for_window(window);
|
workspace.new_container_for_window(window);
|
||||||
@@ -350,6 +352,11 @@ impl WindowManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if workspace_contains_window && workspace_has_monocle_container {
|
||||||
|
self.toggle_monocle()?;
|
||||||
|
window.focus(self.mouse_follows_focus)?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WindowManagerEvent::MoveResizeStart(_, window) => {
|
WindowManagerEvent::MoveResizeStart(_, window) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user