diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2011-08-19 14:41:57 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2011-08-29 17:12:36 -0400 |
commit | f790c79ec71a371552077253539efeeb7966a9d1 (patch) | |
tree | 923769079360102af9067366628ef7757fa4deab /clients/simple-shm.c | |
parent | d9551a3377698841aacbb26b801cca37c03f47fc (diff) |
Use wl_display_bind() for binding to globals
Diffstat (limited to 'clients/simple-shm.c')
-rw-r--r-- | clients/simple-shm.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/clients/simple-shm.c b/clients/simple-shm.c index 7b45005..f064fcd 100644 --- a/clients/simple-shm.c +++ b/clients/simple-shm.c @@ -152,7 +152,8 @@ compositor_handle_visual(void *data, switch (token) { case WL_COMPOSITOR_VISUAL_XRGB32: - d->xrgb_visual = wl_visual_create(d->display, id, 1); + d->xrgb_visual = wl_display_bind(d->display, + id, &wl_visual_interface); break; } } @@ -168,13 +169,14 @@ display_handle_global(struct wl_display *display, uint32_t id, struct display *d = data; if (strcmp(interface, "wl_compositor") == 0) { - d->compositor = wl_compositor_create(display, id, 1); + d->compositor = + wl_display_bind(display, id, &wl_compositor_interface); wl_compositor_add_listener(d->compositor, &compositor_listener, d); } else if (strcmp(interface, "wl_shell") == 0) { - d->shell = wl_shell_create(display, id, 1); + d->shell = wl_display_bind(display, id, &wl_shell_interface); } else if (strcmp(interface, "wl_shm") == 0) { - d->shm = wl_shm_create(display, id, 1); + d->shm = wl_display_bind(display, id, &wl_shm_interface); } } @@ -192,6 +194,7 @@ static struct display * create_display(void) { struct display *display; + int i; display = malloc(sizeof *display); display->display = wl_display_connect(NULL); @@ -203,7 +206,7 @@ create_display(void) wl_display_get_fd(display->display, event_mask_update, display); - while (!display->xrgb_visual) + while (display->xrgb_visual) wl_display_roundtrip(display->display); return display; |