[PATCH weston] libweston-desktop/xdg-shell-v6: Ensure configure timer remains

Daniel Stone daniels at collabora.com
Thu Aug 24 09:53:12 UTC 2017


The old code for scheduling configure events on idle looked like:
if (configure_scheduled) {
    if (this_event_is_the_same) {
        remove_timer();
	return;
    }
}

If we queued one new event (either changed, or the client had never
received any configure event), followed immediately by one event which
was the same as the first, we would delete the scheduled send of the
first event.

Fix this by never removing the idle timer if we have one set; if we
queued a configure at some point, we have something we meant to send
out. This fixes GTK+ clients hanging on start, waiting for a configure
event which will never arrive: the initial configure event gets queued,
but calling set_maximised(false) causes the 'same event' check to get
tripped which promptly deletes the timer, and no event is ever sent.

Signed-off-by: Daniel Stone <daniels at collabora.com>
Cc: Quentin Glidic <sardemff7+git at sardemff7.net>
---
 libweston-desktop/xdg-shell-v6.c | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/libweston-desktop/xdg-shell-v6.c b/libweston-desktop/xdg-shell-v6.c
index de5d3e05..df311037 100644
--- a/libweston-desktop/xdg-shell-v6.c
+++ b/libweston-desktop/xdg-shell-v6.c
@@ -941,21 +941,13 @@ weston_desktop_xdg_surface_schedule_configure(struct weston_desktop_xdg_surface
 		break;
 	}
 
-	if (surface->configure_idle != NULL) {
-		if (!pending_same)
-			return;
+	if (pending_same || surface->configure_idle)
+		return;
 
-		wl_event_source_remove(surface->configure_idle);
-		surface->configure_idle = NULL;
-	} else {
-		if (pending_same)
-			return;
-
-		surface->configure_idle =
-			wl_event_loop_add_idle(loop,
-					       weston_desktop_xdg_surface_send_configure,
-					       surface);
-	}
+	surface->configure_idle =
+		wl_event_loop_add_idle(loop,
+				       weston_desktop_xdg_surface_send_configure,
+				       surface);
 }
 
 static void
-- 
2.13.5



More information about the wayland-devel mailing list