I have a slight problem with the shutdown hooks of...
# compose-desktop
x
I have a slight problem with the shutdown hooks of the runtime used by the AppManager event
onAppExit
So when shutting down I'd like to run logic to check if the current work project is saved. The typical "Do you wanna save your work before quit?".
Copy code
private fun initializeEvents() {
    AppManager.setEvents(
        onAppExit = {
            AppShutdownService().shutdown()
        }
    )
}
This is my code for that.
AppShutdownService
actually calls a JFileChooser window if the user has not saved his/her project. The problem is that this does not mix well with the Runtime.shutdownHook cause it's bringing up a dialog etc. Long story short - the whole thing does not work out. I am somewhat looking for a hook that runs BEFORE the actual exit occurs (if the user presses the X button)