diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 16:24:56 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 16:24:56 +0300 |
| commit | ed963bba0b234d52fda14b2a8237dbf02ef4d655 (patch) | |
| tree | 0c7bd51ff01089fbc810f94a55e0adb94084478e /examples/hello.c | |
| parent | 4a61a0f8a749831b74aca04302a30ebbbb6f5586 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'examples/hello.c')
| -rw-r--r-- | examples/hello.c | 9 |
1 files changed, 0 insertions, 9 deletions
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 <yasl/app.h> - #include <stdio.h> 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); |
