4 * i3 - an improved dynamic tiling window manager
6 * (c) 2009 Michael Stapelberg and contributors
8 * See file LICENSE for license information.
14 /* Debug functions here, especially the FormatEvent-stuff, which prints unhandled events */
16 static const char *labelError[] = {
37 static const char *labelRequest[] = {
40 "ChangeWindowAttributes",
41 "GetWindowAttributes",
68 "ChangeActivePointerGrab",
118 "CopyColormapAndFree",
121 "ListInstalledColormaps",
138 "ChangeKeyboardMapping",
139 "GetKeyboardMapping",
140 "ChangeKeyboardControl",
141 "GetKeyboardControl",
143 "ChangePointerControl",
156 "SetModifierMapping",
157 "GetModifierMapping",
168 static const char *labelEvent[] = {
206 static const char *labelSendEvent[] = {
211 int format_event(xcb_generic_event_t *e) {
215 sendEvent = (e->response_type & 0x80) ? 1 : 0;
216 e->response_type &= ~0x80;
217 seqnum = *((uint16_t *) e + 1);
219 switch(e->response_type) {
221 printf("Error %s on seqnum %d (%s).\n",
222 labelError[*((uint8_t *) e + 1)],
224 labelRequest[*((uint8_t *) e + 10)]);
227 printf("Event %s following seqnum %d%s.\n",
228 labelEvent[e->response_type],
230 labelSendEvent[sendEvent]);
232 case XCB_KEYMAP_NOTIFY:
233 printf("Event %s%s.\n",
234 labelEvent[e->response_type],
235 labelSendEvent[sendEvent]);
243 int handle_event(void *ignored, xcb_connection_t *c, xcb_generic_event_t *e) {
244 return format_event(e);