Skip to content

Commit

Permalink
fix: Check if a restored window is active
Browse files Browse the repository at this point in the history
For some windows like Windows Explorer there seems to be no focus event
when restoring them from e.g. a hidden state.
So when a window is restored, check whether it's the active one and if so
treat the restore event like a focus.
  • Loading branch information
imawizard committed Jun 22, 2024
1 parent 4f3efde commit 19783e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/miguru/miguru.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ class MiguruWM extends WMEvents {
return
}

if event == EV_WINDOW_FOCUSED || hwnd == this._maybeActiveWindow {
if event == EV_WINDOW_FOCUSED || hwnd == this._maybeActiveWindow
|| event == EV_WINDOW_RESTORED && WinExist("A") == hwnd {
this._delayed.Drop(PINNED_WINDOW_FOCUSED)
if !this._pinned.Has(hwnd) {
this._focus(hwnd, monitor, ws)
Expand Down

0 comments on commit 19783e4

Please sign in to comment.