summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pouillon <npouillon@freebox.fr>2012-05-02 08:46:47 +0200
committerKristian Høgsberg <krh@bitplanet.net>2012-05-02 09:35:39 -0400
commitc1b6dbbacdb1b54d1521f0952906387b8df14beb (patch)
tree37a1206b3a0b774c6eb201a78380fbfb55b50572
parent5177e7698446619ee229e1c00c04ea34179cc6af (diff)
server: Post new globals to current clients
Globals are bursted to client on conntect. Now when new global objects are added to the server state, existing clients also get notified.
-rw-r--r--src/wayland-server.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wayland-server.c b/src/wayland-server.c
index b19e05b..d0c31bf 100644
--- a/src/wayland-server.c
+++ b/src/wayland-server.c
@@ -838,6 +838,7 @@ wl_display_add_global(struct wl_display *display,
void *data, wl_global_bind_func_t bind)
{
struct wl_global *global;
+ struct wl_client *client;
global = malloc(sizeof *global);
if (global == NULL)
@@ -849,6 +850,13 @@ wl_display_add_global(struct wl_display *display,
global->bind = bind;
wl_list_insert(display->global_list.prev, &global->link);
+ wl_list_for_each(client, &display->client_list, link)
+ wl_resource_post_event(client->display_resource,
+ WL_DISPLAY_GLOBAL,
+ global->name,
+ global->interface->name,
+ global->interface->version);
+
return global;
}