Compare commits

...

2 Commits

Author SHA1 Message Date
LGUG2Z
57825db886 wip 2024-05-19 11:51:10 -07:00
LGUG2Z
bdf66cc362 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
2024-05-19 11:08:06 -07:00
2 changed files with 15 additions and 2 deletions

View File

@@ -334,8 +334,10 @@ impl WindowManager {
if proceed {
let behaviour = self.window_container_behaviour;
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 {
WindowContainerBehaviour::Create => {
workspace.new_container_for_window(window);
@@ -350,6 +352,13 @@ impl WindowManager {
}
}
}
if matches!(event, WindowManagerEvent::Uncloak(_, _)) {
if workspace_contains_window && workspace_has_monocle_container {
self.toggle_monocle()?;
window.focus(self.mouse_follows_focus)?;
}
}
}
}
WindowManagerEvent::MoveResizeStart(_, window) => {

View File

@@ -1129,7 +1129,11 @@ impl WindowManager {
tracing::info!("focusing container");
let new_idx = workspace.new_idx_for_direction(direction);
let new_idx = if workspace.monocle_container().is_some() {
None
} else {
workspace.new_idx_for_direction(direction)
};
let mut cross_monitor_monocle = false;