From a24989e47bd79cb00978ad3268107b903a578bcb Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 5 Dec 2019 16:36:17 +0200 Subject: [PATCH] xwm: remove configure_source on dispatch This function is called also directly from weston_wm_window_set_toplevel(). If configure_source is set at that point, simply resetting the pointer will "leak" the source until it fires and calls this function again. Let's keep the variable up-to-date by removing the source when called, dispatched or not. This removes the second call. I only hope it doesn't cause issues. This is also necessary if we intend to remove the source on window destruction too. Found by inspection. Signed-off-by: Pekka Paalanen --- xwayland/window-manager.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index c23f7107..0fe33dcf 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -2687,6 +2687,11 @@ weston_wm_window_configure(void *data) uint32_t values[4]; int x, y, width, height; + if (window->configure_source) { + wl_event_source_remove(window->configure_source); + window->configure_source = NULL; + } + weston_wm_window_set_allow_commits(window, false); weston_wm_window_get_child_position(window, &x, &y); @@ -2709,8 +2714,6 @@ weston_wm_window_configure(void *data) XCB_CONFIG_WINDOW_HEIGHT, values); - window->configure_source = NULL; - weston_wm_window_schedule_repaint(window); }