From fb59084fbf03b738276579e121defcc6a586301d Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Fri, 7 Nov 2008 14:27:23 -0500 Subject: Add glib main loop integration, use it in flower client. --- pointer.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'pointer.c') 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); } -- cgit