diff --git a/src/xwayland-unmanaged.c b/src/xwayland-unmanaged.c index 8f8faf79..8c0067bd 100644 --- a/src/xwayland-unmanaged.c +++ b/src/xwayland-unmanaged.c @@ -144,7 +144,6 @@ unmanaged_handle_override_redirect(struct wl_listener *listener, void *data) unmanaged_handle_unmap(&unmanaged->unmap, NULL); } unmanaged_handle_destroy(&unmanaged->destroy, NULL); - xsurface->data = NULL; xwayland_view_create(server, xsurface, mapped); } @@ -185,7 +184,12 @@ xwayland_unmanaged_create(struct server *server, struct xwayland_unmanaged *unmanaged = znew(*unmanaged); unmanaged->server = server; unmanaged->xwayland_surface = xsurface; - xsurface->data = unmanaged; + /* + * xsurface->data is presumed to be a (struct view *) if set, + * so it must be left NULL for an unmanaged surface (it should + * be NULL already at this point). + */ + assert(!xsurface->data); wl_signal_add(&xsurface->events.request_configure, &unmanaged->request_configure); diff --git a/src/xwayland.c b/src/xwayland.c index c07a18b7..ec9fe4a2 100644 --- a/src/xwayland.c +++ b/src/xwayland.c @@ -221,7 +221,8 @@ handle_destroy(struct wl_listener *listener, void *data) /* * Break view <-> xsurface association. Note that the xsurface * may not actually be destroyed at this point; it may become an - * "unmanaged" surface instead. + * "unmanaged" surface instead (in that case it is important + * that xsurface->data not point to the destroyed view). */ xwayland_view->xwayland_surface->data = NULL; xwayland_view->xwayland_surface = NULL;