Added very basic event non-handling
This commit is contained in:
parent
49d022c6b1
commit
a3a90e2735
3 changed files with 19 additions and 1 deletions
|
@ -117,7 +117,13 @@ main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FD_ISSET(g_dpy_fd, &file_descriptors)) {
|
if (FD_ISSET(g_dpy_fd, &file_descriptors)) {
|
||||||
// TODO: handle event
|
xcb_generic_event_t *event = xcb_wait_for_event(g_dpy);
|
||||||
|
|
||||||
|
if (!event) {
|
||||||
|
die("XCB connection broke\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_xcb_event(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,3 +53,14 @@ init_xcb(void)
|
||||||
|
|
||||||
g_dpy_fd = xcb_get_file_descriptor(g_dpy);
|
g_dpy_fd = xcb_get_file_descriptor(g_dpy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
handle_xcb_event(xcb_generic_event_t *event)
|
||||||
|
{
|
||||||
|
// TODO: handle event
|
||||||
|
|
||||||
|
switch (event->response_type) {
|
||||||
|
}
|
||||||
|
|
||||||
|
free(event);
|
||||||
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include <xcb/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
|
|
||||||
void init_xcb(void);
|
void init_xcb(void);
|
||||||
|
void handle_xcb_event(xcb_generic_event_t *event);
|
||||||
|
|
||||||
extern int g_dpy_fd;
|
extern int g_dpy_fd;
|
||||||
extern xcb_connection_t *g_dpy;
|
extern xcb_connection_t *g_dpy;
|
||||||
|
|
Loading…
Add table
Reference in a new issue