summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-02-14 09:54:35 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2011-02-14 09:54:35 (GMT)
commitb46f72e62a5cb781ec94d7cd0317f5cf58c26693 (patch)
tree1230564d17b6ce49c07830a0db9f5147d633e6e3 /src/plugins/platforms/xcb/qxcbconnection.cpp
parent6027b734714aadf22d34f4e99663b4117cdb4a28 (diff)
downloadQt-b46f72e62a5cb781ec94d7cd0317f5cf58c26693.zip
Qt-b46f72e62a5cb781ec94d7cd0317f5cf58c26693.tar.gz
Qt-b46f72e62a5cb781ec94d7cd0317f5cf58c26693.tar.bz2
More debugging of XCB events.
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp84
1 files changed, 46 insertions, 38 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 3018f56..0696ed3 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -124,49 +124,56 @@ break;
} \
break;
-void unhandledXcbEventError(xcb_generic_event_t *event)
+#define XCB_EVENT_DEBUG
+
+void printXcbEvent(const char *message, xcb_generic_event_t *event)
{
-#define UNHANDLED_XCB_EVENT(event) \
+#ifdef XCB_EVENT_DEBUG
+#define PRINT_XCB_EVENT(event) \
case event: \
- printf("Unhandled XCB event: %d - %s\n", event, #event); \
+ printf("%s: %d - %s\n", message, event, #event); \
break;
switch (event->response_type & ~0x80) {
- UNHANDLED_XCB_EVENT(XCB_KEY_PRESS);
- UNHANDLED_XCB_EVENT(XCB_KEY_RELEASE);
- UNHANDLED_XCB_EVENT(XCB_BUTTON_PRESS);
- UNHANDLED_XCB_EVENT(XCB_BUTTON_RELEASE);
- UNHANDLED_XCB_EVENT(XCB_MOTION_NOTIFY);
- UNHANDLED_XCB_EVENT(XCB_ENTER_NOTIFY);
- UNHANDLED_XCB_EVENT(XCB_LEAVE_NOTIFY);
- UNHANDLED_XCB_EVENT(XCB_FOCUS_IN);
- UNHANDLED_XCB_EVENT(XCB_FOCUS_OUT);
- UNHANDLED_XCB_EVENT(XCB_KEYMAP_NOTIFY);
- UNHANDLED_XCB_EVENT(XCB_EXPOSE);
- UNHANDLED_XCB_EVENT(XCB_GRAPHICS_EXPOSURE);
- UNHANDLED_XCB_EVENT(XCB_VISIBILITY_NOTIFY);
- UNHANDLED_XCB_EVENT(XCB_CREATE_NOTIFY);
- UNHANDLED_XCB_EVENT(XCB_DESTROY_NOTIFY);
- UNHANDLED_XCB_EVENT(XCB_UNMAP_NOTIFY);
- UNHANDLED_XCB_EVENT(XCB_MAP_NOTIFY);
- UNHANDLED_XCB_EVENT(XCB_MAP_REQUEST);
- UNHANDLED_XCB_EVENT(XCB_REPARENT_NOTIFY);
- UNHANDLED_XCB_EVENT(XCB_CONFIGURE_NOTIFY);
- UNHANDLED_XCB_EVENT(XCB_CONFIGURE_REQUEST);
- UNHANDLED_XCB_EVENT(XCB_GRAVITY_NOTIFY);
- UNHANDLED_XCB_EVENT(XCB_RESIZE_REQUEST);
- UNHANDLED_XCB_EVENT(XCB_CIRCULATE_NOTIFY);
- UNHANDLED_XCB_EVENT(XCB_CIRCULATE_REQUEST);
- UNHANDLED_XCB_EVENT(XCB_PROPERTY_NOTIFY);
- UNHANDLED_XCB_EVENT(XCB_SELECTION_CLEAR);
- UNHANDLED_XCB_EVENT(XCB_SELECTION_REQUEST);
- UNHANDLED_XCB_EVENT(XCB_SELECTION_NOTIFY);
- UNHANDLED_XCB_EVENT(XCB_COLORMAP_NOTIFY);
- UNHANDLED_XCB_EVENT(XCB_CLIENT_MESSAGE);
- UNHANDLED_XCB_EVENT(XCB_MAPPING_NOTIFY);
+ PRINT_XCB_EVENT(XCB_KEY_PRESS);
+ PRINT_XCB_EVENT(XCB_KEY_RELEASE);
+ PRINT_XCB_EVENT(XCB_BUTTON_PRESS);
+ PRINT_XCB_EVENT(XCB_BUTTON_RELEASE);
+ PRINT_XCB_EVENT(XCB_MOTION_NOTIFY);
+ PRINT_XCB_EVENT(XCB_ENTER_NOTIFY);
+ PRINT_XCB_EVENT(XCB_LEAVE_NOTIFY);
+ PRINT_XCB_EVENT(XCB_FOCUS_IN);
+ PRINT_XCB_EVENT(XCB_FOCUS_OUT);
+ PRINT_XCB_EVENT(XCB_KEYMAP_NOTIFY);
+ PRINT_XCB_EVENT(XCB_EXPOSE);
+ PRINT_XCB_EVENT(XCB_GRAPHICS_EXPOSURE);
+ PRINT_XCB_EVENT(XCB_VISIBILITY_NOTIFY);
+ PRINT_XCB_EVENT(XCB_CREATE_NOTIFY);
+ PRINT_XCB_EVENT(XCB_DESTROY_NOTIFY);
+ PRINT_XCB_EVENT(XCB_UNMAP_NOTIFY);
+ PRINT_XCB_EVENT(XCB_MAP_NOTIFY);
+ PRINT_XCB_EVENT(XCB_MAP_REQUEST);
+ PRINT_XCB_EVENT(XCB_REPARENT_NOTIFY);
+ PRINT_XCB_EVENT(XCB_CONFIGURE_NOTIFY);
+ PRINT_XCB_EVENT(XCB_CONFIGURE_REQUEST);
+ PRINT_XCB_EVENT(XCB_GRAVITY_NOTIFY);
+ PRINT_XCB_EVENT(XCB_RESIZE_REQUEST);
+ PRINT_XCB_EVENT(XCB_CIRCULATE_NOTIFY);
+ PRINT_XCB_EVENT(XCB_CIRCULATE_REQUEST);
+ PRINT_XCB_EVENT(XCB_PROPERTY_NOTIFY);
+ PRINT_XCB_EVENT(XCB_SELECTION_CLEAR);
+ PRINT_XCB_EVENT(XCB_SELECTION_REQUEST);
+ PRINT_XCB_EVENT(XCB_SELECTION_NOTIFY);
+ PRINT_XCB_EVENT(XCB_COLORMAP_NOTIFY);
+ PRINT_XCB_EVENT(XCB_CLIENT_MESSAGE);
+ PRINT_XCB_EVENT(XCB_MAPPING_NOTIFY);
default:
- printf("Unhandled XCB event: %d - %s\n", event->response_type, "unknown");
+ printf("%s: %d - %s\n", message, event->response_type, "unknown");
}
+#else
+ Q_UNUSED(message);
+ Q_UNUSED(event);
+#endif
}
void QXcbConnection::eventDispatcher()
@@ -201,9 +208,10 @@ void QXcbConnection::eventDispatcher()
m_keyboard->handleMappingNotifyEvent((xcb_mapping_notify_event_t *)event);
break;
default:
- unhandledXcbEventError(event);
- break;
+ printXcbEvent("Unhandled XCB event", event);
+ return;
}
+ printXcbEvent("Handled XCB event", event);
}
}