[clutter/wip/wayland-for-demo: 1/5] wayland: Don't loop until we get globals
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/wip/wayland-for-demo: 1/5] wayland: Don't loop until we get globals
- Date: Wed, 5 Mar 2014 15:20:07 +0000 (UTC)
commit 6e522eca42b0dc4b01fed6c4139302820002e822
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sat Feb 15 13:06:58 2014 -0500
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.
clutter/wayland/clutter-backend-wayland.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/clutter/wayland/clutter-backend-wayland.c b/clutter/wayland/clutter-backend-wayland.c
index aa3bc7b..2645d5c 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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]