Skip to content

Commit

Permalink
🐛 Fix window focus handling
Browse files Browse the repository at this point in the history
  • Loading branch information
john-walks-slow committed Feb 27, 2024
1 parent 60ea275 commit 6509baa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/toggleWnd.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ toggleWnd(id, entry := unset) {
try {
DetectHiddenWindows(false)
wndList := WinGetList()
topWnd := wndList[wndList.FindIndex((wnd) => WinGetMinMax(wnd) > -1) + 1]
WinActivate(topWnd)
DetectHiddenWindows(true)
wndIndex := wndList.FindIndex((wnd) => WinGetMinMax(wnd) > -1, 2)
if (wndIndex !== 0) {
WinActivate(wndList[wndIndex])
}
}
}
; Handle exit, try to reuse handler
Expand Down Expand Up @@ -129,7 +131,7 @@ toggleWnd(id, entry := unset) {
try {
if (WinGetMinMax(id) == -1)
WinRestore(id)
; WinActivate(id)
WinActivate(id)
activatedWnd := id
}
}
Expand Down

0 comments on commit 6509baa

Please sign in to comment.