From 9e946e148d58cb7258afe30274e6195f62bfbb71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Fri, 4 Sep 2026 09:06:26 +0200 Subject: [PATCH] [client] Tie install-progress hidden-window restore to the current popup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- client/ui/services/windowmanager.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/client/ui/services/windowmanager.go b/client/ui/services/windowmanager.go index 1d18331b7..2b38a4e2e 100644 --- a/client/ui/services/windowmanager.go +++ b/client/ui/services/windowmanager.go @@ -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()