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>
This commit is contained in:
Pekka Paalanen 2019-12-05 16:36:17 +02:00 committed by Daniel Stone
parent 134e14969f
commit a24989e47b

View File

@ -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);
}