From 26454e3115fd482d7252e5cc8cb24d2c64dacb60 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Wed, 20 Oct 2021 20:34:47 +0100 Subject: [PATCH] xwayland: clear wlr_xwayland_surface in handle_destroy Avoids wlr_xwayland_surface becoming a dangling pointer if a view is not destroyed immediately. See swaywm/sway@215787e8 --- src/xwayland.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xwayland.c b/src/xwayland.c index 8d401853..3f64061e 100644 --- a/src/xwayland.c +++ b/src/xwayland.c @@ -81,6 +81,7 @@ handle_destroy(struct wl_listener *listener, void *data) if (view->toplevel_handle) { wlr_foreign_toplevel_handle_v1_destroy(view->toplevel_handle); } + view->xwayland_surface = NULL; wl_list_remove(&view->link); wl_list_remove(&view->map.link); wl_list_remove(&view->unmap.link); @@ -97,7 +98,7 @@ handle_request_configure(struct wl_listener *listener, void *data) { struct view *view = wl_container_of(listener, view, request_configure); struct wlr_xwayland_surface_configure_event *event = data; - + int min_width, min_height; view_min_size(view, &min_width, &min_height);