Skip to content

lib/ui: no programmatic way to stop app_loop — a File→Exit menu item cannot quit the app #564

Description

@InauguralPhysicist

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions