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 --- src/common/app.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/app.c b/src/common/app.c index 9d52e4a..435d020 100644 --- a/src/common/app.c +++ b/src/common/app.c @@ -111,8 +111,13 @@ static void app_runner_surface_close(struct yasl_surface *s, void *ud) { struct app_surface *as = ud; struct app_runner *ar = as ? as->runner : NULL; - if (!ar || !ar->desc || !ar->desc->event) + if (!ar || !ar->desc) + return; + /* Without an event callback nothing could answer the request, so quit. */ + if (!ar->desc->event) { + ar->running = false; return; + } emit(ar, &(struct yasl_event){ .type = YASL_EVENT_WINDOW_CLOSE, -- cgit v1.2.3