Skip to content

Allow never opening window + terminate on last window, with guards #1339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

ychin
Copy link
Member

@ychin ychin commented Nov 5, 2022

Previously we disabled this combo in f6ba7dd because when implemented naively, it causes an issue where just opening an About MacVim or Settings window could immediately cause MacVim to exit (because macOS determined that there were no non-auxillary window open). This was awkward and potentially made it hard to change the setting back, and exact behavior depended on OS behavior.

However, it seems like there are legit use case for this combo of settings. Change it so that we allow setting both of them again, but add checks so that applicationShouldTerminateAfterLastWindowClosed: will only return YES if we have opened at least one Vim window before. This gives the user a chance to open a window first, so using Settings etc wouldn't immediately terminate the app.

Fix #1338

…last window"

This reverts commit f6ba7dd.

This change was reverted as part of macvim-dev#1338 as we want to implement a
different solution.
@ychin ychin added this to the Release 175 milestone Nov 5, 2022
Previously we disabled this combo in f6ba7dd because when
implemented naively, it causes an issue where just opening an About
MacVim or Settings window could immediately cause MacVim to exit
(because macOS determined that there were no non-auxillary window open).
This was awkward and potentially made it hard to change the setting
back, and exact behavior depended on OS behavior.

However, it seems like there are legit use case for this combo of
settings. Change it so that we allow setting both of them again, but add
checks so that `applicationShouldTerminateAfterLastWindowClosed:` will
only return `YES` if we have opened at least one Vim window before. This
gives the user a chance to open a window first, so using Settings etc
wouldn't immediately terminate the app.

Fix macvim-dev#1338
@ychin ychin force-pushed the allow-untitled-window-never-terminate-window-again branch from e1cab27 to cabb495 Compare November 5, 2022 01:57
@ychin ychin merged commit 89c1ea2 into macvim-dev:master Nov 5, 2022
@ychin ychin deleted the allow-untitled-window-never-terminate-window-again branch November 5, 2022 04:57
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.

"After last window closes" setting ignored
1 participant