diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-08-18 10:07:35 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-08-18 13:49:28 +0200 |
commit | 59ba84d31cf17d86e615e2958fece6f6e0bbefe2 (patch) | |
tree | 57fab7471fe045cba896eee0cf5bfc14ccdec7e9 /src/plugins/platforms/xcb/qxcbconnection.cpp | |
parent | 6efa8cd70aedf13edef9143eb57b52bd175fb748 (diff) |
xcb XInput: use categorized logging for devices and events
[ChangeLog][Platform Specific Changes][X11 / XCB] environment variables
QT_XCB_DEBUG_XINPUT and QT_XCB_DEBUG_XINPUT_DEVICES are deprecated and
replaced with logging categories qt.qpa.events.input and
qt.qpa.devices respectively
Change-Id: I287a56de5cb9ece2ac14df6510b9aa52c864c99b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index ff8a6e2d76..6a9abb5faf 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -92,6 +92,9 @@ QT_BEGIN_NAMESPACE +Q_LOGGING_CATEGORY(lcQpaXInput, "qt.qpa.events.input") +Q_LOGGING_CATEGORY(lcQpaXInputDevices, "qt.qpa.devices") + #ifdef XCB_USE_XLIB static const char * const xcbConnectionErrors[] = { "No error", /* Error 0 */ @@ -324,8 +327,6 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra , has_input_shape(false) , has_touch_without_mouse_emulation(false) , has_xkb(false) - , debug_xinput_devices(false) - , debug_xinput(false) , m_buttons(0) , m_focusWindow(0) , m_systemTrayTracker(0) @@ -798,8 +799,7 @@ void QXcbConnection::handleButtonPress(xcb_generic_event_t *ev) // the rest we need to manage ourselves m_buttons = (m_buttons & ~0x7) | translateMouseButtons(event->state); m_buttons |= translateMouseButton(event->detail); - if (Q_UNLIKELY(debug_xinput)) - qDebug("xcb: pressed mouse button %d, button state %X", event->detail, static_cast<unsigned int>(m_buttons)); + qCDebug(lcQpaXInput, "xcb: pressed mouse button %d, button state %X", event->detail, static_cast<unsigned int>(m_buttons)); } void QXcbConnection::handleButtonRelease(xcb_generic_event_t *ev) @@ -810,8 +810,7 @@ void QXcbConnection::handleButtonRelease(xcb_generic_event_t *ev) // the rest we need to manage ourselves m_buttons = (m_buttons & ~0x7) | translateMouseButtons(event->state); m_buttons &= ~translateMouseButton(event->detail); - if (Q_UNLIKELY(debug_xinput)) - qDebug("xcb: released mouse button %d, button state %X", event->detail, static_cast<unsigned int>(m_buttons)); + qCDebug(lcQpaXInput, "xcb: released mouse button %d, button state %X", event->detail, static_cast<unsigned int>(m_buttons)); } #ifndef QT_NO_XKB @@ -864,7 +863,7 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event) handleButtonRelease(event); HANDLE_PLATFORM_WINDOW_EVENT(xcb_button_release_event_t, event, handleButtonReleaseEvent); case XCB_MOTION_NOTIFY: - if (Q_UNLIKELY(debug_xinput)) { + if (Q_UNLIKELY(lcQpaXInput().isDebugEnabled())) { xcb_motion_notify_event_t *mev = (xcb_motion_notify_event_t *)event; qDebug("xcb: moved mouse to %4d, %4d; button state %X", mev->event_x, mev->event_y, static_cast<unsigned int>(m_buttons)); } |