From 73bf1c8bd6bbeabe2c05cee8a8a55edbd45e7982 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 27 Dec 2025 13:54:17 +0100 Subject: [PATCH] xwayland: fix crash when request_fullscreen is called while unmapped Closes: https://github.com/cage-kiosk/cage/issues/463 --- xwayland.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xwayland.c b/xwayland.c index 4c3281e..89d7270 100644 --- a/xwayland.c +++ b/xwayland.c @@ -116,8 +116,10 @@ handle_xwayland_surface_request_fullscreen(struct wl_listener *listener, void *d struct cg_xwayland_view *xwayland_view = wl_container_of(listener, xwayland_view, request_fullscreen); struct wlr_xwayland_surface *xwayland_surface = xwayland_view->xwayland_surface; wlr_xwayland_surface_set_fullscreen(xwayland_view->xwayland_surface, xwayland_surface->fullscreen); - wlr_foreign_toplevel_handle_v1_set_fullscreen(xwayland_view->view.foreign_toplevel_handle, - xwayland_surface->fullscreen); + if (xwayland_view->view.foreign_toplevel_handle) { + wlr_foreign_toplevel_handle_v1_set_fullscreen(xwayland_view->view.foreign_toplevel_handle, + xwayland_surface->fullscreen); + } } static void @@ -148,6 +150,8 @@ handle_xwayland_surface_map(struct wl_listener *listener, void *data) if (xwayland_view->xwayland_surface->class) wlr_foreign_toplevel_handle_v1_set_app_id(view->foreign_toplevel_handle, xwayland_view->xwayland_surface->class); + wlr_foreign_toplevel_handle_v1_set_fullscreen(view->foreign_toplevel_handle, + xwayland_view->xwayland_surface->fullscreen); } static void