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.
Bill Spitzak 13 years ago committed by Kristian Høgsberg
parent 771241e88f
commit b715ceca33
  1. 5
      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)

Loading…
Cancel
Save