diff --git a/src/wayland-server.c b/src/wayland-server.c
index c845dd6..dac3143 100644
--- a/src/wayland-server.c
+++ b/src/wayland-server.c
@@ -729,12 +729,33 @@ unbind_resource(struct wl_resource *resource)
 }
 
 static void
+shuffle_globals(struct wl_array *globals_array)
+{
+	size_t i, j;
+	struct wl_global **globals = globals_array->data;
+	struct wl_global *global;
+	size_t n = globals_array->size / sizeof global;
+
+	if (n <= 1)
+		return;
+
+	for (i = 0; i < n - 1; i++) {
+		j = i + (rand() % (n - (i + 1))) + 1;
+		global = globals[j];
+		globals[j] = globals[i];
+		globals[i] = global;
+	}
+}
+
+static void
 display_get_registry(struct wl_client *client,
 		     struct wl_resource *resource, uint32_t id)
 {
 	struct wl_display *display = resource->data;
 	struct wl_resource *registry_resource;
 	struct wl_global *global;
+	struct wl_array globals;
+	struct wl_global **global_ptr;
 
 	registry_resource =
 		wl_resource_create(client, &wl_registry_interface, 1, id);
@@ -750,12 +771,22 @@ display_get_registry(struct wl_client *client,
 	wl_list_insert(&display->registry_resource_list,
 		       &registry_resource->link);
 
-	wl_list_for_each(global, &display->global_list, link)
-		wl_resource_post_event(registry_resource,
-				       WL_REGISTRY_GLOBAL,
-				       global->name,
-				       global->interface->name,
-				       global->version);
+	wl_array_init(&globals);
+	wl_list_for_each(global, &display->global_list, link) {
+		global_ptr = wl_array_add(&globals, sizeof global);
+		*global_ptr = global;
+	}
+
+	shuffle_globals(&globals);
+
+	wl_array_for_each(global_ptr, &globals) {
+		global = *global_ptr;
+		wl_registry_send_global(registry_resource,
+					global->name,
+					global->interface->name,
+					global->version);
+	}
+	wl_array_release(&globals);
 }
 
 static const struct wl_display_interface display_interface = {
