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 <pekka.paalanen@collabora.com>
dev
Pekka Paalanen 5 years ago committed by Daniel Stone
parent 134e14969f
commit a24989e47b
  1. 7
      xwayland/window-manager.c

@ -2687,6 +2687,11 @@ weston_wm_window_configure(void *data)
uint32_t values[4]; uint32_t values[4];
int x, y, width, height; 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_set_allow_commits(window, false);
weston_wm_window_get_child_position(window, &x, &y); weston_wm_window_get_child_position(window, &x, &y);
@ -2709,8 +2714,6 @@ weston_wm_window_configure(void *data)
XCB_CONFIG_WINDOW_HEIGHT, XCB_CONFIG_WINDOW_HEIGHT,
values); values);
window->configure_source = NULL;
weston_wm_window_schedule_repaint(window); weston_wm_window_schedule_repaint(window);
} }

Loading…
Cancel
Save