From 71cb49b84738b63d18a4486b41dd835448cb3081 Mon Sep 17 00:00:00 2001 From: Axel Wagner Date: Tue, 27 Jul 2010 10:18:29 +0200 Subject: [PATCH] Move XCB-Event-Handling to xcb.c --- i3bar/src/main.c | 5 +---- i3bar/src/xcb.c | 6 +++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/i3bar/src/main.c b/i3bar/src/main.c index c58dc25e..0be8a7a7 100644 --- a/i3bar/src/main.c +++ b/i3bar/src/main.c @@ -19,10 +19,7 @@ void ev_prepare_cb(struct ev_loop *loop, ev_prepare *w, int revents) { void ev_check_cb(struct ev_loop *loop, ev_check *w, int revents) { xcb_generic_event_t *event; if ((event = xcb_poll_for_event(xcb_connection)) != NULL) { - switch (event->response_type & ~0x80) { - case XCB_EXPOSE: - draw_buttons(); - } + handle_xcb_event(event); free(event); } } diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index 6e0d9082..38ceb947 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -20,7 +20,11 @@ uint32_t get_colorpixel(const char *s) { } void handle_xcb_event(xcb_generic_event_t ev) { - + switch (event->response_type & ~0x80) { + case XCB_EXPOSE: + draw_buttons(); + break; + } } int get_string_width(char *string) { -- 2.39.5