summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-08-18 11:07:51 +0200
committerLiang Qi <liang.qi@qt.io>2016-08-18 11:07:51 +0200
commit0ca4fcbc36527ce02b604aa88e8bd0d37d40baf4 (patch)
tree6adf165fb783272d720416a49a51d9ad169d16de /src/plugins/platforms/xcb/qxcbconnection.cpp
parent9aeaa363e533e1486e6e9d7526bbab7c2472be5e (diff)
parent748aa6b06462804a9671997302df292ae9788d5c (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: src/plugins/platforms/xcb/qxcbintegration.cpp Change-Id: I2d71d06a55f730df19ace0dd3304238584a0497f
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index fded4de76a..05107932f9 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -107,6 +107,7 @@ QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcQpaXInput, "qt.qpa.input")
Q_LOGGING_CATEGORY(lcQpaXInputDevices, "qt.qpa.input.devices")
+Q_LOGGING_CATEGORY(lcQpaXInputEvents, "qt.qpa.input.events")
Q_LOGGING_CATEGORY(lcQpaScreen, "qt.qpa.screen")
// this event type was added in libxcb 1.10,
@@ -1119,7 +1120,8 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
// the rest we need to manage ourselves
m_buttons = (m_buttons & ~0x7) | translateMouseButtons(ev->state);
m_buttons |= translateMouseButton(ev->detail);
- qCDebug(lcQpaXInput, "legacy mouse press, button %d state %X", ev->detail, static_cast<unsigned int>(m_buttons));
+ if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
+ qCDebug(lcQpaXInputEvents, "legacy mouse press, button %d state %X", ev->detail, static_cast<unsigned int>(m_buttons));
HANDLE_PLATFORM_WINDOW_EVENT(xcb_button_press_event_t, event, handleButtonPressEvent);
}
case XCB_BUTTON_RELEASE: {
@@ -1127,15 +1129,17 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
m_keyboard->updateXKBStateFromCore(ev->state);
m_buttons = (m_buttons & ~0x7) | translateMouseButtons(ev->state);
m_buttons &= ~translateMouseButton(ev->detail);
- qCDebug(lcQpaXInput, "legacy mouse release, button %d state %X", ev->detail, static_cast<unsigned int>(m_buttons));
+ if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
+ qCDebug(lcQpaXInputEvents, "legacy mouse release, button %d state %X", ev->detail, static_cast<unsigned int>(m_buttons));
HANDLE_PLATFORM_WINDOW_EVENT(xcb_button_release_event_t, event, handleButtonReleaseEvent);
}
case XCB_MOTION_NOTIFY: {
xcb_motion_notify_event_t *ev = (xcb_motion_notify_event_t *)event;
m_keyboard->updateXKBStateFromCore(ev->state);
m_buttons = (m_buttons & ~0x7) | translateMouseButtons(ev->state);
- qCDebug(lcQpaXInput, "legacy mouse move %d,%d button %d state %X", ev->event_x, ev->event_y,
- ev->detail, static_cast<unsigned int>(m_buttons));
+ if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
+ qCDebug(lcQpaXInputEvents, "legacy mouse move %d,%d button %d state %X", ev->event_x, ev->event_y,
+ ev->detail, static_cast<unsigned int>(m_buttons));
HANDLE_PLATFORM_WINDOW_EVENT(xcb_motion_notify_event_t, event, handleMotionNotifyEvent);
}