mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-29 23:47:24 +02:00
fix(wm): ensure focus restore on float + max hwnds
This commit ensures that when switching to a workspace which contains a floating window or a maximized window, either the maximized window or the first floating window index will be focused. This is to prevent windows which have been hidden on the previous workspace from retaining keyboard focus. fix #1130
This commit is contained in:
@@ -246,6 +246,10 @@ impl Workspace {
|
||||
if let Some(window) = to_focus {
|
||||
if self.maximized_window().is_none() && self.floating_windows().is_empty() {
|
||||
window.focus(mouse_follows_focus)?;
|
||||
} else if let Some(maximized_window) = self.maximized_window() {
|
||||
maximized_window.focus(mouse_follows_focus)?;
|
||||
} else if let Some(floating_window) = self.floating_windows().first() {
|
||||
floating_window.focus(mouse_follows_focus)?;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user