xwayland/xwm: assert that we're not overwriting when associating

Make sure xwayland_surface_associate() is not called twice in a
row without a xwayland_surface_dissociate() call in-between.
This commit is contained in:
Simon Ser 2022-12-22 15:44:15 +01:00
parent a922428c41
commit 445ce7eac6

View file

@ -885,6 +885,8 @@ static const struct wlr_addon_interface surface_addon_impl = {
static void xwayland_surface_associate(struct wlr_xwm *xwm,
struct wlr_xwayland_surface *xsurface, struct wlr_surface *surface) {
assert(xsurface->surface == NULL);
wl_list_remove(&xsurface->unpaired_link);
wl_list_init(&xsurface->unpaired_link);
xsurface->surface_id = 0;