From 6a6bbc3b756706bdade01434f1ee8d8cbe7dd854 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 12 May 2016 14:51:51 +0200 Subject: [PATCH] xwayland: Restore wl_display_roundtrip() in InitInput This partially revert commit 984be78 The rountrip in Xwayland's InitInput() is unlikely the culprit for the crash reported in bug 95337, even though it's triggered from InitInput(). Startup goes like this: xwl_screen_init() xwl_output_create() wl_display_roundtrip() InitInput() wl_display_roundtrip() ConnectionInfo initialized What happens in bug 95337 is that some output data is already available when we reach InitInput()'s wl_display_roundtrip() and therefore we end up trying to update the ConnectionInfo's data from RR routines before ConnectionInfo is actually initialized. Removing the wl_display_roundtrip() from InitInput() will not fix the issue (although it would make it less lileky to happen), because xwl_screen_init() also does a wl_display_roundtrip() after creating the output, so the race that led to bug 95337 remains. However, re-setting the xwl_screen->expecting_event to 0 again in InitInput() still doesn't seem right. so this part is not restored (thus a partial revert). Signed-off-by: Olivier Fourdan Reviewed-by: Adam Jackson Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95337 --- hw/xwayland/xwayland-input.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index 16e715567..0735d43c7 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -969,6 +969,10 @@ InitInput(int argc, char *argv[]) xwl_screen->input_registry = wl_display_get_registry(xwl_screen->display); wl_registry_add_listener(xwl_screen->input_registry, &input_listener, xwl_screen); + + wl_display_roundtrip(xwl_screen->display); + while (xwl_screen->expecting_event) + wl_display_roundtrip(xwl_screen->display); } void