jan
jan copied to clipboard
leave the app window active in the dock when closing on mac
fixes #584
If its macOS, if the close button on the window is pressed we close all windows but we leave the app active in the dock otherwise we quit the app, this quit functionality using cmd + q shortcut on macOS still quits the app completely.
Should still be tested on other OSs.
quick demo:
https://github.com/janhq/jan/assets/82527700/8ac29ac3-e530-4460-883b-a33a95df3f2b
Thank you for the quick update. I would like to provide some additional information so that you can proceed with the PR:
- The app needs to clean up resources when all windows are closed, such as killing Nitro subprocesses. This can be done by calling the
stopModel()function. It would be better to decouplecleanUpAndQuitintocleanResourcesandapp.quit()so we can call the corresponding action per platform. - For other OS like Windows and Linux, we must clean up resources before quitting.
Please let me know if you need me to proceed with the changes. Thank you again for your contribution. We appreciate all the help from the community.
cc @Gri-ffin
I've added some changes to cleanup the resources, @louis-jan does this do what is required?
I've added some changes to cleanup the resources, @louis-jan does this do what is required?
Thanks for the update, it looks great.
Could you please also remove cleanUpAndQuit method, its now can be replaced by your new function:
cleanResources()
app.quit()
Idk why the test is failed on this PR, could you please investigate 🙏
should work now
Looks great @Gri-ffin. I will test it out a bit on other platforms and let you know.
Hi @Gri-ffin, I conducted some testing and identified an issue with state synchronization. When the window is closed with the API Server enabled, reopening it does not sync with the server state immediately. As a result, the 'Enable API Server' toggle stops working.
This PR is around for a month and there is no updates ever since. I'm closing this PR, please feel free to re-open it once you have been able to test. Thank you @Gri-ffin