summaryrefslogtreecommitdiffstats
path: root/pointer.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-11-07 14:27:23 -0500
committerKristian Høgsberg <krh@redhat.com>2008-11-07 14:27:23 -0500
commitfb59084fbf03b738276579e121defcc6a586301d (patch)
treec61fd19f2c181a0c00c4c3e2619a29f7f69ff2dc /pointer.c
parent7f77bd8fbedee8a8a1fbb26776084ccaffc2a087 (diff)
downloadwayland-fb59084fbf03b738276579e121defcc6a586301d.tar.gz
wayland-fb59084fbf03b738276579e121defcc6a586301d.tar.xz
wayland-fb59084fbf03b738276579e121defcc6a586301d.zip
Add glib main loop integration, use it in flower client.
Diffstat (limited to 'pointer.c')
-rw-r--r--pointer.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/pointer.c b/pointer.c
index cd2cb0b..1233f8c 100644
--- a/pointer.c
+++ b/pointer.c
@@ -98,15 +98,14 @@ draw_pointer(int width, int height)
}
static int
-connection_update(struct wl_connection *connection,
- uint32_t mask, void *data)
+connection_update(uint32_t mask, void *data)
{
struct pollfd *p = data;
p->events = 0;
- if (mask & WL_CONNECTION_READABLE)
+ if (mask & WL_DISPLAY_READABLE)
p->events |= POLLIN;
- if (mask & WL_CONNECTION_WRITABLE)
+ if (mask & WL_DISPLAY_WRITABLE)
p->events |= POLLOUT;
return 0;
@@ -142,13 +141,12 @@ int main(int argc, char *argv[])
return -1;
}
- display = wl_display_create(socket_name,
- connection_update, &p[0]);
+ display = wl_display_create(socket_name);
if (display == NULL) {
fprintf(stderr, "failed to create display: %m\n");
return -1;
}
- p[0].fd = wl_display_get_fd(display);
+ p[0].fd = wl_display_get_fd(display, connection_update, &p[0]);
pointer.width = 16;
pointer.height = 16;
@@ -168,9 +166,9 @@ int main(int argc, char *argv[])
poll(p, 1, -1);
mask = 0;
if (p[0].revents & POLLIN)
- mask |= WL_CONNECTION_READABLE;
+ mask |= WL_DISPLAY_READABLE;
if (p[0].revents & POLLOUT)
- mask |= WL_CONNECTION_WRITABLE;
+ mask |= WL_DISPLAY_WRITABLE;
wl_display_iterate(display, mask);
}