unmanaged_handle_unmap(&unmanaged->unmap, NULL);
}
unmanaged_handle_destroy(&unmanaged->destroy, NULL);
- xsurface->data = NULL;
xwayland_view_create(server, xsurface, mapped);
}
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);
/*
* 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;