[bug] Main window onCloseRequested
is not triggered when the window is closed via APIs
#5288
Labels
onCloseRequested
is not triggered when the window is closed via APIs
#5288
Describe the bug
It seems the main window's
onCloseRequested
is correctly triggered when user closes the app with top right X button or Alt+F4, but not triggered via APIs such asappWindow.close()
orexit()
.Reproduction
Expected behavior
Closing the app or main window via API should also trigger
onCloseRequested
.Platform and versions
Stack trace
No response
Additional context
This is needed so that the app can do necessary clean up and save data to file regardless of how user initiates the app termination. Otherwise, we have to duplicate the clean-up logic to all the possible routes.
The text was updated successfully, but these errors were encountered: