From ed963bba0b234d52fda14b2a8237dbf02ef4d655 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Tue, 13 Oct 2026 16:24:56 +0300 Subject: Quit on window close when the app has no event callback Without yasl_app_desc.event, a close request had nowhere to go and the window stayed open. The runner now stops instead, so hello drops its event callback. Co-Authored-By: Claude Opus 5.5 --- examples/hello.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'examples') diff --git a/examples/hello.c b/examples/hello.c index d3d74cf..38a0cac 100644 --- a/examples/hello.c +++ b/examples/hello.c @@ -1,16 +1,8 @@ /* A complete CPU-rendered window. Build instructions: docs/getting-started.md. */ #include - #include static bool failed; - -static enum yasl_app_result event(void *ud, const struct yasl_event *event) -{ - (void)ud; - return event->type == YASL_EVENT_WINDOW_CLOSE ? YASL_APP_QUIT : YASL_APP_CONTINUE; -} - static void draw(void *ud, struct yasl_surface *surface, struct yasl_frame_context *frame) { (void)ud; @@ -31,7 +23,6 @@ int main(void) struct yasl_app_desc desc = { .app_id = "org.example.hello", .window = &window, - .event = event, .frame = draw, }; int result = yasl_run(&desc); -- cgit v1.2.3