Closed jwanja closed 2 years ago
Also I just realized if I press any menu bar item, e.g "MacVim", "File", "Edit", etc., and then press the menu bar item again, the application will close.
Oh that’s interesting. Does seem like a bug.
Just out of curiosity though why would you have those two options? It seems somewhat contradictory and I’m curious why someone would configure MacVim that way.
I've tested with the latest MacVim 9.0.65 (173) on Catalina.
Could you please explain me, where is the contradiction?
@ychin it 100% is contradictory to have the settings configured the way I did. I've already changed those options to something sane, but I couldn't help but investigate what was happening when the About screen disappeared immediately when I opened it up.
I have a unique use case since I'm using MacVim as a proxy to have a reliably updated vim executable since my company blocked homebrew on our machines. For the most part I'm using vim in a terminal and have aliased it to point to MacVim's instance of vim. I really only open the GUI when I need to open a large file to search around in faster than TextEdit, or when I feel like it has been a while since I've updated MacVim and more importantly updated the vim version.
I've tested with the latest MacVim 9.0.65 (173) on Catalina.
I set the options below and reload MacVim
- Open untitled window === "never"
- After last window closes === "Quit MacVim"
- I opened MacVim and opened preferences window, closed it without changes and MacVim exited which agree with my understanding of "Quit after last window closes"
- I opened MacVim and opened about window, closed it without changes and MacVim exited which agree with my understanding of "Quit after last window closes"
- I opened settings and new editor window. Closing one of windows doesn't quit the app, which agree with my understanding of "Quit after last window closes"
Could you please explain me, where is the contradiction?
@eirnym for me, step 3 has a different behavior. When I choose the option to open the About MacVim window, if it will be the only window owned by MacVim, it flashes on screen very quickly, then automatically closes itself, and then MacVim exits.
I observe the flash, but it's not doing every time I close MacVim and I can't consistently say, that this is any kind of a ghost window or not.
Additionally, I observe similar flashing when closing Terminal.app
, Preview.app
and few others I've just tested when I close the app which has no open windows left. This flash is not quite visible when there's no opened browser with 100 tabs spread to few windows opened. I believe the opening and the closing animations are played independently if there're any opened windows or not.
Could you try to disable or minimize closing macOS animations by using ui tweaks or changing defaults?
This setting is done by using the applicationShouldTerminateAfterLastWindowClosed
API. It's kind of up to macOS when it calls it and when it feels like closing the application, so maybe it depends on different conditions.
I think I will just make it clear that the options of "Open untitled window === never" and "After last window closes === Quit MacVim" cannot be set together. Maybe add some preference pane logic to make it so as well, and/or enforcing this mutual exclusion in the code. It just doesn't make sense to have them set together, as by definition macOS should immediately close the app. In fact I wonder if in a future version of macOS, having those options set together would cause MacVim to keep closing itself causing the user to never be able to change the setting in the preference pane which would be bad, so this should be fixed (the user can obviously still use the terminal to set it using defaults
, but that's not ideal).
Steps to reproduce
I have a hunch that the issue is from the combination of these two options:
If I open a blank window or change the "After last window closes" option to "Keep MacVim Running", the About MacVIm window will stay open.
Expected behaviour
Be able to view the "About MacVim" window at any time and with any settings configuration.
Version of Vim and architecture
9.0.65
Environment
Monterey 12.4 iTerm 2 "xterm-256color"
How MacVim was installed
GitHub
Logs and stack traces
No response
Vim configuration where issue is reproducable
No response
Issue has been tested with given configuration
Issue has been tested with no configuration
mvim --clean
(orgvim
, supplied by MacVim distribution)vim --clean
(in terminal, supplied by MacVim distribution)vim --clean
(in terminal, other suppliers, e.g. /usr/bin/vim)Other conditions