summaryrefslogtreecommitdiff
path: root/event/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'event/events.c')
-rw-r--r--event/events.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/event/events.c b/event/events.c
index 399c6ce..c19d01f 100644
--- a/event/events.c
+++ b/event/events.c
@@ -62,7 +62,7 @@ int xcb_handle_event(xcb_event_handlers_t *evenths, xcb_generic_event_t *event)
return 0;
}
-void xcb_event_loop(xcb_event_handlers_t *evenths)
+void xcb_wait_for_event_loop(xcb_event_handlers_t *evenths)
{
xcb_generic_event_t *event;
while((event = xcb_wait_for_event(evenths->c)))
@@ -72,6 +72,16 @@ void xcb_event_loop(xcb_event_handlers_t *evenths)
}
}
+void xcb_poll_for_event_loop(xcb_event_handlers_t *evenths)
+{
+ xcb_generic_event_t *event;
+ while ((event = xcb_poll_for_event(evenths->c)))
+ {
+ handle_event(evenths, event);
+ free(event);
+ }
+}
+
static void set_handler(xcb_generic_event_handler_t handler, void *data, xcb_event_handler_t *place)
{
xcb_event_handler_t eventh = { handler, data };