]> git.sur5r.net Git - i3/i3/commitdiff
Move XCB-Event-Handling to xcb.c
authorAxel Wagner <mail@merovius.de>
Tue, 27 Jul 2010 08:18:29 +0000 (10:18 +0200)
committerAxel Wagner <mail@merovius.de>
Tue, 27 Jul 2010 08:18:29 +0000 (10:18 +0200)
i3bar/src/main.c
i3bar/src/xcb.c

index c58dc25e442112cb7430e586aafc70a25f85360d..0be8a7a71f56e9da29859be726958113c74dda95 100644 (file)
@@ -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);
        }
 }
index 6e0d908201e428139c0a401a2ed151d0a74d0bcf..38ceb947e27f7b5611805d4d408de52459b4b9a8 100644 (file)
@@ -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) {