From e24b8a8cef001e1c7e50ab12b739486f59b2a850 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Tue, 13 Oct 2026 15:43:04 +0300 Subject: Let yasl_app_desc describe its initial window A new optional yasl_app_desc.window spec makes yasl_run() create that toplevel and request its first frame before init(), which is now optional too. If creation fails, yasl_run() closes the display and returns an error without calling init(). Co-Authored-By: Claude Opus 5.5 --- include/yasl/app.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/yasl') diff --git a/include/yasl/app.h b/include/yasl/app.h index f067d5b..79b2519 100644 --- a/include/yasl/app.h +++ b/include/yasl/app.h @@ -148,10 +148,16 @@ struct yasl_app_desc { enum yasl_backend backend; /** User data passed to all callbacks. */ void *userdata; + /** + * Optional toplevel created before init(), with its first frame requested. + * Borrowed for the call; spec cbs and ud are ignored as for any runner window. + * yasl_run() returns an error without calling init() if creation fails. + */ + const struct yasl_window_spec *window; /** - * Called once after display and event machinery initialization. - * Use this to create windows and initialize application resources. + * Optional; called once after display and event machinery initialization. + * Use this to create further windows and initialize application resources. * Return YASL_APP_CONTINUE or YASL_APP_QUIT. */ enum yasl_app_result (*init)(void *ud, struct yasl_display *d); -- cgit v1.2.3