From b715ceca332a823705974b984622de748eed2460 Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Tue, 5 Jun 2012 17:08:23 -0400 Subject: [PATCH] compositor-x11: Return number of events processed The event handler is supposed to return 0 if no events were handled and a positive number if events were handled. event always end up being NULL however, so we always return 0. --- src/compositor-x11.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compositor-x11.c b/src/compositor-x11.c index d23553e4..edb6f048 100644 --- a/src/compositor-x11.c +++ b/src/compositor-x11.c @@ -619,8 +619,10 @@ x11_compositor_handle_event(int fd, uint32_t mask, void *data) uint32_t *k; uint32_t i, set; wl_fixed_t x, y; + int count; prev = NULL; + count = 0; while (x11_compositor_next_event(c, &event, mask)) { switch (prev ? prev->response_type & ~0x80 : 0x80) { case XCB_KEY_RELEASE: @@ -756,6 +758,7 @@ x11_compositor_handle_event(int fd, uint32_t mask, void *data) break; } + count++; if (prev != event) free (event); } @@ -774,7 +777,7 @@ x11_compositor_handle_event(int fd, uint32_t mask, void *data) break; } - return event != NULL; + return count; } #define F(field) offsetof(struct x11_compositor, field)