[client] Tie install-progress hidden-window restore to the current popup

CloseInstallProgress nils s.installProgress before calling w.Close(), so a
replacement popup can open before the old window's WindowClosing event runs.
The old callback then restored the windows the replacement had just hidden,
because the restore sat outside the identity check.

Guard the restore with the same check the state reset uses, and restore from
CloseInstallProgress itself so the programmatic close path still re-shows the
hidden windows — mirroring how CloseBrowserLogin already handles it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Zoltán Papp
2026-09-04 09:06:26 +02:00
co-authored by Claude Opus 5
parent 6f6e9db35d
commit 9e946e148d
+10 -1
View File
@@ -411,10 +411,13 @@ func (s *WindowManager) OpenInstallProgress(version string) {
s.installProgress = w
w.OnWindowEvent(events.Common.WindowClosing, func(_ *application.WindowEvent) {
s.mu.Lock()
// Only a live user close still has this registered; CloseInstallProgress
// nils s.installProgress first and restores itself. Guarding here stops a
// stale close event from re-showing windows a replacement popup hides.
if s.installProgress == w {
s.installProgress = nil
s.restoreHiddenWindowsLocked()
}
s.restoreHiddenWindowsLocked()
s.forgetWindowLocked(w)
s.mu.Unlock()
})
@@ -433,6 +436,12 @@ func (s *WindowManager) CloseInstallProgress() {
s.mu.Lock()
w := s.installProgress
s.installProgress = nil
// The guarded WindowClosing handler no-ops on a programmatic close, so restore
// here — but only if a popup was actually open, since hiddenForLogin is shared
// with OpenBrowserLogin.
if w != nil {
s.restoreHiddenWindowsLocked()
}
s.mu.Unlock()
if w != nil {
w.Close()