Move XCB-Event-Handling to xcb.c
This commit is contained in:
@ -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) {
|
void ev_check_cb(struct ev_loop *loop, ev_check *w, int revents) {
|
||||||
xcb_generic_event_t *event;
|
xcb_generic_event_t *event;
|
||||||
if ((event = xcb_poll_for_event(xcb_connection)) != NULL) {
|
if ((event = xcb_poll_for_event(xcb_connection)) != NULL) {
|
||||||
switch (event->response_type & ~0x80) {
|
handle_xcb_event(event);
|
||||||
case XCB_EXPOSE:
|
|
||||||
draw_buttons();
|
|
||||||
}
|
|
||||||
free(event);
|
free(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,11 @@ uint32_t get_colorpixel(const char *s) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void handle_xcb_event(xcb_generic_event_t ev) {
|
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) {
|
int get_string_width(char *string) {
|
||||||
|
Reference in New Issue
Block a user