Skip to content

Fix app quitting when opening the first document from the Open dialog#1

Open
bganesh wants to merge 1 commit intoJackYoung27:mainfrom
bganesh:fix-exit-on-file-open
Open

Fix app quitting when opening the first document from the Open dialog#1
bganesh wants to merge 1 commit intoJackYoung27:mainfrom
bganesh:fix-exit-on-file-open

Conversation

@bganesh
Copy link
Copy Markdown

@bganesh bganesh commented Apr 20, 2026

When the app was launched without an initial document, it immediately presented the Open dialog. After selecting a file, the dialog closed before the preview window was created. Because
the app was configured to terminate after the last window closed, AppKit could treat the closed Open dialog as leaving the app with no visible windows and quit before the selected
document opened.

This changes the app lifecycle so closing the last document window no longer terminates the app. It also removes the explicit termination path when the initial Open dialog is cancelled.
With this behavior, the app can remain open without any document windows, and opening the first document from the Open dialog works the same way as opening subsequent documents or opening
files via Finder drag/drop.

Fixes #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The app quits unexpectedly when opening the first document from the Open dialog

2 participants