summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-05-13 22:18:43 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-05-13 22:19:10 +0200
commit3d4aeb791990f359e277efbfb0a1f1793945b55d (patch)
treee877b7b4ad76d554aa3dbe6131d03b98a7447c63 /src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
parentb861c43395b17d5df34f24853faa21b9824a53af (diff)
parentc8de2a8b5f5d0b9b3bc1d8ed8d3027ac40b00ee3 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/gui/kernel/qguiapplication.cpp Change-Id: Ibe75603dc8a51769db6550ea3f07bc8d19b0be85
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection_xi2.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index 831ccba6f6..efa1691780 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -575,7 +575,7 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin
#ifdef XCB_USE_XINPUT21
xXIGenericDeviceEvent *xiEvent = reinterpret_cast<xXIGenericDeviceEvent *>(event);
- if (xiEvent->evtype == XI_Motion) {
+ if (xiEvent->evtype == XI_Motion && scrollingDevice.orientations) {
xXIDeviceEvent* xiDeviceEvent = reinterpret_cast<xXIDeviceEvent *>(event);
if (QXcbWindow *platformWindow = platformWindowFromId(xiDeviceEvent->event)) {
QPoint rawDelta;
@@ -612,20 +612,20 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin
QWindowSystemInterface::handleWheelEvent(platformWindow->window(), xiEvent->time, local, global, rawDelta, angleDelta, modifiers);
}
}
- } else if (xiEvent->evtype == XI_ButtonRelease) {
+ } else if (xiEvent->evtype == XI_ButtonRelease && scrollingDevice.legacyOrientations) {
xXIDeviceEvent* xiDeviceEvent = reinterpret_cast<xXIDeviceEvent *>(event);
if (QXcbWindow *platformWindow = platformWindowFromId(xiDeviceEvent->event)) {
QPoint angleDelta;
if (scrollingDevice.legacyOrientations & Qt::Vertical) {
- if (xi2GetButtonState(xiDeviceEvent, 4))
+ if (xiDeviceEvent->detail == 4)
angleDelta.setY(120);
- else if (xi2GetButtonState(xiDeviceEvent, 5))
+ else if (xiDeviceEvent->detail == 5)
angleDelta.setY(-120);
}
if (scrollingDevice.legacyOrientations & Qt::Horizontal) {
- if (xi2GetButtonState(xiDeviceEvent, 6))
+ if (xiDeviceEvent->detail == 6)
angleDelta.setX(120);
- if (xi2GetButtonState(xiDeviceEvent, 7))
+ else if (xiDeviceEvent->detail == 7)
angleDelta.setX(-120);
}
if (!angleDelta.isNull()) {