From d26bd78644544151b42600c5358d0fecc84b14f1 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Mon, 12 Oct 2026 22:43:23 +0300 Subject: feat: implement modern Approach A app runner, unified events, notepad, and game examples --- src/common/backend.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/common/backend.c') diff --git a/src/common/backend.c b/src/common/backend.c index 23275d6..e690697 100644 --- a/src/common/backend.c +++ b/src/common/backend.c @@ -1,5 +1,6 @@ #include "backend.h" #include "loop.h" +#include "common/app_internal.h" #include #include @@ -167,6 +168,9 @@ struct yasl_surface *yasl_create_toplevel(struct yasl_display *d, errno = 0; struct yasl_surface *s = d->ops->surface_create_toplevel(d, spec, graphics_device); if (!s && !errno) errno = ENODEV; + if (s && d->app_runner) { + app_runner_register_surface(d->app_runner, s); + } return s; } @@ -202,6 +206,9 @@ struct yasl_surface *yasl_surface_create_popup(struct yasl_surface *parent, cons errno = 0; struct yasl_surface *s = parent->display->ops->surface_create_popup(parent, spec); if (!s && !errno) errno = ENODEV; + if (s && parent->display->app_runner) { + app_runner_register_surface(parent->display->app_runner, s); + } return s; } @@ -226,6 +233,9 @@ void yasl_surface_destroy(struct yasl_surface *s) { if (!s || !s->display->ops->surface_destroy) return; + if (s->app_surface && s->display->app_runner) { + app_runner_unregister_surface(s->display->app_runner, s); + } yasl_surface_clear_timers(s); input_queue_clear(&s->input); s->display->ops->surface_destroy(s); -- cgit v1.2.3