summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbwindow.cpp
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@qt.io>2017-06-06 11:33:39 +0200
committerGatis Paeglis <gatis.paeglis@qt.io>2017-07-13 11:31:01 +0000
commitac4e848c9802377b7c4ff673180f28b9ca76b746 (patch)
treeece68afcc85cd1282079241f8e4e677d8eee5739 /src/plugins/platforms/xcb/qxcbwindow.cpp
parentf69d30804d4bef729d602a8ec41c7d26689772e2 (diff)
xcb: fix logic in QXcbConnection::initializeXInput2()
Things that were broken: - The return values of XIQueryVersion interpreted wrongly. BadRequest means no XI2 support on the server. Nesting more XIQueryVersion calls to check for lower minor version of XI2 in this case does not make sense. On Success, server's supported X Input version is returned. Server's supported version can be lower than the version we have announced to support. In this case Qt client will be limited by X server's supported version (which is ok, as we do check the available version at runtime via QXcbConnection::isAtLeastXI2*). - The code was _always_ announcing to X server that we support XI 2.2, by ignoring what actually is supported in the specific build (see XCB_USE_XINPUT ifdefs). - qCDebug messages and logging categories were wrong too. Change-Id: Ia84457f125474aa851b7a91ed19fc5b904ac359e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index e6f89fbdb4..7ea60d7fde 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -2451,12 +2451,14 @@ void QXcbWindow::handleXIEnterLeave(xcb_ge_event_t *event)
case XI_Enter: {
const int event_x = fixed1616ToInt(ev->event_x);
const int event_y = fixed1616ToInt(ev->event_y);
- qCDebug(lcQpaXInput, "XI2 mouse enter %d,%d, mode %d, detail %d, time %d", event_x, event_y, ev->mode, ev->detail, ev->time);
+ qCDebug(lcQpaXInputEvents, "XI2 mouse enter %d,%d, mode %d, detail %d, time %d",
+ event_x, event_y, ev->mode, ev->detail, ev->time);
handleEnterNotifyEvent(event_x, event_y, root_x, root_y, ev->mode, ev->detail, ev->time);
break;
}
case XI_Leave:
- qCDebug(lcQpaXInput, "XI2 mouse leave, mode %d, detail %d, time %d", ev->mode, ev->detail, ev->time);
+ qCDebug(lcQpaXInputEvents, "XI2 mouse leave, mode %d, detail %d, time %d",
+ ev->mode, ev->detail, ev->time);
connection()->keyboard()->updateXKBStateFromXI(&ev->mods, &ev->group);
handleLeaveNotifyEvent(root_x, root_y, ev->mode, ev->detail, ev->time);
break;