diff options
author | Maxim Mikityanskiy <maxtram95@gmail.com> | 2015-08-09 13:47:12 +0300 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-12-17 18:55:30 +0000 |
commit | 33c9059f03a67d83123933426ea9164d57399d4c (patch) | |
tree | f6b1e6e240c5f4e3eabc6d8354c61bbbc2cf9f39 | |
parent | ad5c768fc8b93e22201fb557561b2edd4fcdc26b (diff) |
Fix XI2 smooth scroll with inverted direction
When touchpad scroll direction is inverted, verticalIncrement and
horizontalIncrement of scrollingDevice are negative, and rawDelta
remains unfilled. It leads to pixelDelta.isNull() being true in wheel
event handler even when XI2 smooth scrolling is available on the system.
Fix that and fill rawDelta with correct values when inverted scroll
direction is used.
Change-Id: I9c0bdbad2c6b9bbed765eaa895dca300c5c70e86
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index d7688be0ff..5aa1933859 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -859,6 +859,8 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin // We do not set "pixel" delta if it is only measured in ticks. if (scrollingDevice.verticalIncrement > 1) rawDelta.setY(delta); + else if (scrollingDevice.verticalIncrement < -1) + rawDelta.setY(-delta); } } if (scrollingDevice.orientations & Qt::Horizontal) { @@ -869,6 +871,8 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin // We do not set "pixel" delta if it is only measured in ticks. if (scrollingDevice.horizontalIncrement > 1) rawDelta.setX(delta); + else if (scrollingDevice.horizontalIncrement < -1) + rawDelta.setX(-delta); } } if (!angleDelta.isNull()) { |