zulip-desktop
zulip-desktop copied to clipboard
Fixes #1187: Cannot close the app from full screen mode on macOS
What's this PR do? Fixes #1187. App was not closing at fullscreen mode at macOS. Changed the behavior for windows to leave fullscreen and then hide itself for macOS when pressed close button as many applications do so.
Any background context you want to provide?
Screenshots?

You have tested this PR on:
- [ ] Windows
- [ ] Linux/Ubuntu
- [x] macOS
@enesonus On mac os, the application is not meant to explicitly close when all the windows are closed It's a native feature of Mac OS Reference:
- https://www.howtogeek.com/279086/why-do-mac-apps-stay-open-when-i-hit-the-red-x-button/
- https://stackoverflow.com/questions/58822323/for-electron-app-in-macos-when-is-app-quit-invoked
I hope the above helps out
@cyrilchukwuebuka this PR is not for quitting the app, it hides the window as you say so. Issue #1187 states that at fullscreen red x button does not hide or close the window i.e. does nothing. This PR checks if the window is fullscreen, makes the window not fullscreen and then hides it as the native behavior of most apps at macOS when red x is pressed.
Hi @andersk issue #1187 still seems to be persisting and this PR fixes it. Could you please give a review?
@enesonus I’ve edited your commit with a real commit message; this is important for maintaining a readable Git history.
Merged, thanks!
Thanks for the help @andersk! This was one of my first PRs and didn’t exactly know at that time how to write good commit messages.