diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index 25fce72..8647c22 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -116,6 +116,7 @@ #include #include #include +#include #include #include #include @@ -386,6 +387,7 @@ struct wl_compositor_state { int is_nested; /* 1 if using wlr_wl_backend */ struct wlr_backend *headless_inner; /* headless backend (always) */ struct wlr_backend *wl_backend_inner; /* wl backend (nested only) */ + struct wlr_session *session; /* DRM session (standalone only) */ struct wlr_allocator *allocator; struct wlr_scene *scene; struct wlr_scene_output *scene_output; @@ -1810,10 +1812,10 @@ static void handle_output_frame(struct wl_listener *listener, void *data) { (void)listener; (void)data; - /* Skip rendering while the startup pump thread is running — wlr_scene_output_commit - * involves EGL/DRM operations bound to the main thread's GL context. */ if (wl_state.startup_pump_running) return; + if (wl_state.session && !wl_state.session->active) + return; if (!wl_state.scene_output) return; if (wl_state.allocator) { @@ -2092,6 +2094,7 @@ wl_display_open(const char *name) struct wlr_session *session = NULL; wl_state.backend = wlr_backend_autocreate( wl_display_get_event_loop(wl_state.display), &session); + wl_state.session = session; if (!wl_state.backend) { wwarning("wl_backend: wlr_backend_autocreate failed; falling back to headless"); wl_state.backend = wl_state.headless_inner;