From: Axel Wagner Date: Tue, 27 Jul 2010 08:18:29 +0000 (+0200) Subject: Move XCB-Event-Handling to xcb.c X-Git-Tag: 4.0.1~7^2~102 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=71cb49b84738b63d18a4486b41dd835448cb3081;p=i3%2Fi3 Move XCB-Event-Handling to xcb.c --- 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) {