SwiftcordApp/Swiftcord

Close Window quits the app

adamselby opened this issue · 4 comments

Describe the bug
Closing the window quits the app.

To Reproduce

  1. Open Swiftcord
  2. Close the window using ⌘W or "Close" menu item

Expected behavior
On macOS, closing a window of an app should not quit the app.

As per apple guidelines, an app should quit when all its windows are closed. In fact, if an app doesn't do so, it will be rejected from the app store. You can open a new window with command+N and close that, and observe that the app doesn't quit since there's one open window.

This behaviour can be confirmed with built in apps such as System Preferences.app, Notes.app, Music.app etc

Ok that's misinformation, Notes.app and Music.app don't quit when all windows are closed. I might consider changing Swiftcord's behaviour in that aspect.

Admittedly, it's a little inconsistent these days but for a very long time closing a window on a Mac app would not quit the app in any scenario, with one notable exception being System Preferences as you noted. Over the last decade, some document-based apps in particular have adopted Automatic Termination which will quietly quit an app that has no document windows open, if it is not in the foreground. The Mac App Store rule may be related to a requirement to support Automatic Termination?

That said, the expected behavior for Mac apps remains to be that closing an app window does not quit the app, and it's an important aspect of how macOS works. Notably, Discord's official app doesn't do this properly either… Instead, it "hides" the app which is arguably even worse. If you close the Discord window, you'll see in the menu bar that the next most recent app is now in focus and is the foreground app because Discord is incorrectly hiding the app window, instead of closing it. The functionality of Discord is actually what drew me to Swiftcord, because it is a constant annoyance in using the official app for me.

I believe that we do plan on adding this, maybe in the next update but definitely before we add notifications (if we ever do that). I also find apps that quit when the main window closes annoying as well.

As for the App Store policy, the only thing that we could find about that was an almost 3 year old stackoverflow question that said that their app was rejected because the app doesn't quit when the main window is closed. However, I can't find anything about it in the App Store Review Guidelines, so I'm going to assume that the intern at apple was subsequently fired after submitting that review. Also the review guidelines make no mention of Automatic Termination.

Notably, Discord's official app doesn't do this properly either… Instead, it "hides" the app which is arguably even worse.

I think that's an artifact from having the windows version hide to the system tray instead of to the taskbar. It's also a pretty convenient solution for storing and restoring state.