From 445ce7eac63793130fa51f0f5d1811884fa8b579 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 22 Dec 2022 15:44:15 +0100 Subject: 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. --- xwayland/xwm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xwayland') diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 917aaaff..c39f640f 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -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; -- cgit v1.2.3