fix(scrolling): refocus after a window is closed with Hide

Closing a window sends Hide and not Destroy to many applications. The Hide
arm re-tiled without asking Windows to focus the surviving window, so no
window had the foreground and the border did not follow focus. Use the
same refocus rule as the Destroy arm.
This commit is contained in:
LGUG2Z committed 2026-10-30 12:13:42 -07:00
1 parent abb230b450
commit ca22b0f81e
1 file changed
+6 -1
+6 -1
View File
@@ -390,7 +390,12 @@ impl WindowManager {
if hide {
self.focused_workspace_mut()?.remove_window(window.hwnd)?;
self.update_focused_workspace(false, false)?;
// Closing a window sends Hide and not Destroy to many applications, so
// hand focus on to the surviving window as the Destroy arm does
let refocus =
should_refocus_after_destroy(WindowsApi::foreground_window().ok());
self.update_focused_workspace(refocus, refocus)?;
}
let mut already_moved_window_handles = self.already_moved_window_handles.lock();