Found by DeslanStudio milestone 4b wiring the upstream studio's File→Exit (Ctrl+Q) menu action.
app_loop's _running is a local: it flips to 0 only on a quit window event or when the on_key callback returns 0. A widget callback — menu item, button, hotkey handler — has no path to it, so an in-app Exit action cannot end the loop cleanly. The only escape is exit of N from the callback, which skips the gfx_close teardown after the loop.
Suggestion: honor a shared flag — e.g. _ui.quit_requested is 1 (or a request_quit helper) checked in the loop condition alongside _running. One line in app_loop, and callbacks/hotkeys/menu items can all quit.
Downstream workaround (DeslanStudio src/client/studio.eigs): the shell sets its own quit_requested, and the entry point's on_tick calls gfx_close + exit of 0 when it sees it.
Found by DeslanStudio milestone 4b wiring the upstream studio's File→Exit (Ctrl+Q) menu action.
app_loop's_runningis a local: it flips to 0 only on aquitwindow event or when theon_keycallback returns 0. A widget callback — menu item, button, hotkey handler — has no path to it, so an in-app Exit action cannot end the loop cleanly. The only escape isexit of Nfrom the callback, which skips thegfx_closeteardown after the loop.Suggestion: honor a shared flag — e.g.
_ui.quit_requested is 1(or arequest_quithelper) checked in the loop condition alongside_running. One line in app_loop, and callbacks/hotkeys/menu items can all quit.Downstream workaround (DeslanStudio
src/client/studio.eigs): the shell sets its ownquit_requested, and the entry point'son_tickcallsgfx_close+exit of 0when it sees it.