summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2014-02-15 13:06:58 -0500
committerJasper St. Pierre <jstpierre@mecheye.net>2014-03-05 10:20:50 -0500
commit7c8c1a91971c1656fabc0d2ac35ef8e0fd670415 (patch)
tree0265885fea699375c635a6df18d49e02aa624329
parent3c344fe5eda34e1221da23818a2ce297d0f22125 (diff)
downloadclutter-7c8c1a91971c1656fabc0d2ac35ef8e0fd670415.tar.gz
wayland: Don't loop until we get globals
A single wl_display_sync should be enough for all globals to appear, so simply do it once and error out if we don't see the globals we want.
-rw-r--r--clutter/wayland/clutter-backend-wayland.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/clutter/wayland/clutter-backend-wayland.c b/clutter/wayland/clutter-backend-wayland.c
index aa3bc7bb5..2645d5c32 100644
--- a/clutter/wayland/clutter-backend-wayland.c
+++ b/clutter/wayland/clutter-backend-wayland.c
@@ -217,10 +217,18 @@ clutter_backend_wayland_post_parse (ClutterBackend *backend,
&wayland_registry_listener,
backend_wayland);
- /* Wait until we have been notified about the compositor and shell objects */
- while (!(backend_wayland->wayland_compositor &&
- backend_wayland->wayland_shell))
- wl_display_roundtrip (backend_wayland->wayland_display);
+ /*
+ * Ensure that that we've received the messages setting up the
+ * compostor and shell object.
+ */
+ wl_display_roundtrip (backend_wayland->wayland_display);
+ if (!backend_wayland->wayland_compositor || !backend_wayland->wayland_shell)
+ {
+ g_set_error (error, CLUTTER_INIT_ERROR,
+ CLUTTER_INIT_ERROR_BACKEND,
+ "Unable to find wl_compositor or wl_shell");
+ return FALSE;
+ }
return TRUE;
}