From 35b28891f46a648f4b4d749b973632a1a0ee2e62 Mon Sep 17 00:00:00 2001 From: joten Date: Fri, 31 Oct 2014 16:20:31 +0100 Subject: [PATCH] Extended the bug fix from r145:dc91cfafb64c ... ... to all methods of closing windows --- src/Manager.ahk | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Manager.ahk b/src/Manager.ahk index 0b27b71..ac1f504 100644 --- a/src/Manager.ahk +++ b/src/Manager.ahk @@ -1187,9 +1187,18 @@ Manager_toggleDecor() Manager_winSet("Style", "-0xC00000", aWndId) } -Manager_unmanage(wndId) -{ - Local a +Manager_unmanage(wndId) { + Local a, aView, wndId0, wndIds + + ;; Find the next window that should have focus. + ;; If there is no such window, choose the bar on the same monitor. + aView := Monitor_#%Manager_aMonitor%_aView_#1 + wndIds := View_#%Manager_aMonitor%_#%aView%_wndIds + StringSplit, wndId, wndIds, `; + If (wndId0 < 3) + Manager_winActivate(0) + Else + View_activateWindow(1) ;; Do our best to make sure that any unmanaged windows are left visible. Manager_winShow(wndId)