forked from akai/readest
5190bbcafc
On macOS, closing the last window (Cmd+W or the red traffic light) was quitting the app, which is unexpected — the native convention is that Cmd+W closes the window while the app keeps running in the dock, and only Cmd+Q quits. Intercept the window CloseRequested event on macOS, prevent the close, and hide the window instead so the app remains active. Handle the Reopen event (fired when the user clicks the dock icon) to restore the hidden window. Cmd+Q continues to go through applicationWillTerminate: and exits the app normally.