Move XCB-Event-Handling to xcb.c
This commit is contained in:
parent
ff2ee04e0d
commit
71cb49b847
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue