wayland: Wait for output and seat information
authorMatthias Clasen <mclasen@redhat.com>
Thu, 9 Apr 2015 04:14:20 +0000 (00:14 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 9 Apr 2015 04:14:20 +0000 (00:14 -0400)
When we open the connection, we get the wl_output object,
but we return before all the information such as monitor
geometry has arrived, which causes us to misinform early
users of this information. Do a roundtrip here that causes
us to wait until the information is complete. Do the same
for seats, just in case.
https://bugzilla.gnome.org/show_bug.cgi?id=747471

gdk/wayland/gdkdisplay-wayland.c

index 6d9a50e8ab54955c206fa47c0423a3fda38f6e64..6df25cff06b8255607a955fe34c8a69b3213842d 100644 (file)
@@ -193,11 +193,13 @@ gdk_registry_handle_global (void               *data,
       output =
         wl_registry_bind (display_wayland->wl_registry, id, &wl_output_interface, MIN (version, 2));
       _gdk_wayland_screen_add_output (display_wayland->screen, id, output, MIN (version, 2));
+      wl_display_roundtrip (display_wayland->wl_display);
     }
   else if (strcmp (interface, "wl_seat") == 0)
     {
       seat = wl_registry_bind (display_wayland->wl_registry, id, &wl_seat_interface, MIN (version, 4));
       _gdk_wayland_device_manager_add_seat (gdk_display->device_manager, id, seat);
+      wl_display_roundtrip (display_wayland->wl_display);
     }
   else if (strcmp (interface, "wl_data_device_manager") == 0)
     {