From 8e1d7fe4da7d2c2f2299242263d528c69986cac7 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Tue, 25 Oct 2022 15:06:24 -0500 Subject: [PATCH] xwm: Init window link after removing it In future code the window link will end up in a state where it may or may not be on the unpaired_window_list and we'll want to go from that state to one where it's definitely not on the list. Initting the list after removal (in these two places) allows us to unconditionally remove it later. Signed-off-by: Derek Foreman --- xwayland/window-manager.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index cb17f52d5..ec41651b3 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -1318,6 +1318,7 @@ weston_wm_handle_unmap_notify(struct weston_wm *wm, xcb_generic_event_t *event) * was mapped before this unmap request. */ wl_list_remove(&window->link); + wl_list_init(&window->link); window->surface_id = 0; } if (wm->focus_window == window) @@ -1604,6 +1605,7 @@ weston_wm_window_create(struct weston_wm *wm, window->decor_bottom = -1; window->decor_left = -1; window->decor_right = -1; + wl_list_init(&window->link); weston_output_weak_ref_init(&window->legacy_fullscreen_output); geometry_reply = xcb_get_geometry_reply(wm->conn, geometry_cookie, NULL);