macOS updater: the download sheet never shows after Install Update, and the window stays grey
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- macos, objective-c
- Ambito
- desktop
Direzione di ricerca
Read the macOS updater’s updatePresentationWindow method and trace where downloadUpdateVersion presents its progress sheet from the “A new version” completion handler. Reproduce the reported sequence with the standalone Objective-C example or packaged app, then check that the download sheet appears on the app window with its progress bar and Cancel button after the first sheet closes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The problem
On macOS, clicking Install Update in the “A new version of is available” sheet never shows the download sheet. The window stays grey until the download finishes, then the app quits and relaunches. The user sees no progress and no Cancel button, so the app looks frozen for the whole download. Sage’s update ZIP is 229 MB, so that can take minutes.
This is true in 0.11.1 and on current main (4d47c2c). It was seen on macOS 27.2.1 (26B131).
The cause
downloadUpdateVersion runs inside the completion handler of the “A new version” sheet. At that moment, the closing alert panel is still NSApp.keyWindow, still visible, and still attached to the app’s window. updatePresentationWindow returns NSApp.keyWindow first:
- (NSWindow *)updatePresentationWindow {
NSWindow *keyWindow = NSApp.keyWindow;
if (keyWindow.isVisible && !keyWindow.miniaturized) return keyWindow;
...
}
So the download sheet is attached to the closing alert, not to the app’s window. The alert then finishes closing and takes the download sheet with it. Logged from a replay of this code (trimmed):
[completion] key=_NSAlertPanel(sheet=1 visible=1 parent=main) chosen=_NSAlertPanel(...)
[t+0] progress.window=_NSAlertPanel(sheet=1 visible=1) progress.parent=_NSAlertPanel(parent=main)
[t+1.5s] key=nil main.attachedSheet=nil progress.window=_NSAlertPanel(sheet=1 visible=0) progress.parent=_NSAlertPanel(visible=0 parent=nil)
The download keeps running. When it ends, the completion block finds downloadAlert.window.sheetParent (the hidden alert), ends the sheet there, and installs the update as usual.
Reproduction
A standalone Objective-C program reproduces it without an update feed. It copies updatePresentationWindow, presentUpdateAlert, and the sheet part of downloadUpdateVersion. Its window has a full-size content view, a transparent titlebar, and a WKWebView. It shows the “A new version” sheet and clicks Install Update with performClick:. A second later, the window is grey with no sheet. The same happens in a packaged app with a real feed.
The fix
Return the window the sheet belongs to, never a sheet:
- (NSWindow *)updatePresentationWindow {
NSWindow *keyWindow = NSApp.keyWindow;
while (keyWindow.sheetParent) keyWindow = keyWindow.sheetParent;
if (keyWindow.isVisible && !keyWindow.miniaturized && !keyWindow.isSheet) return keyWindow;
for (NSWindow *window in NSApp.orderedWindows) {
if (window.isVisible && !window.miniaturized && !window.isSheet) return window;
}
for (NSWindow *window in self.windows.allValues) {
if (window.isVisible && !window.miniaturized) return window;
}
return nil;
}
With the window chosen this way, AppKit queues the download sheet until the “A new version” sheet has closed, then shows it. With the sheetParent walk, the replay shows the download sheet with its bar and Cancel.
Notes
- The fallback loop. While an alert is up,
NSApp.orderedWindowslists the alert first. On macOS 27.2.1 it also lists private_NSGlassEffectWindows. Skipping sheets there keeps the fallback, used when no window is key, from making the same mistake. - A real progress bar. vercel-labs/native#936 asks for a determinate bar in this sheet and an update API for apps. This bug is separate, because no bar shows at all today.
- Sage’s workaround. Until a fix ships, Sage replaces
updatePresentationWindowthrough the Objective-C runtime, with the samesheetParentwalk (wasimxyz/sage#95). It checks each method’s name and type encoding first, so a fix or rename here turns the workaround off rather than breaking it.
- Lingua principale
- Zig
- Stelle
- 7.9k
- Fork
- 335
- Merge medio
- 10h 33m
- PR unite (30g)
- 147
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di vercel-labs/native
-
Per-view widget layout budget (1024 nodes) drops whole frames on real multi-pane app viewsForse già presa @slicenferqin l’ha presa 100 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
vercel-labs/native#408 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
vercel-labs/native#387 ·
I maintainer di solito rispondono entro 1 giorno
-
macOS: the window frame event reports the frame size where everything else expects the content sizeAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
vercel-labs/native#355 ·
I maintainer di solito rispondono entro 1 giorno
-
cef.zig: InstallResult.archive_path leaks on successForse già presa @versecafe l’ha presa 206 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
vercel-labs/native#32 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
vercel-labs/native#957 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di vercel-labs/native
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
GUI: the space panel stays stale after a run stops with no spaceForse già presa @nikkexe0-del l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
xevrion/hatchzip#237 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
flathub/org.ardour.Ardour#89 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Javis603/token-monitor#1861 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno