diff options
author | Gatis Paeglis <gatis.paeglis@qt.io> | 2017-05-29 10:59:18 +0200 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@qt.io> | 2017-06-08 12:40:46 +0000 |
commit | 41ae544c40e0568bd627a992a23b8c8f8f5cc27d (patch) | |
tree | c6ced7b52cb67e6919aa086617c695b0bd0de226 /src/plugins/platforms/xcb | |
parent | c3a115b90d38d3faac7edcb4ab29f4406a4e382a (diff) |
xcb,evdevmouse: don't use qpa compatibility functions
Change-Id: If3f474dcb6ee117c6dd26cd56fd4ad8d39e60e1f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 1a360239c3..0a4e3a5107 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -2190,14 +2190,18 @@ void QXcbWindow::handleButtonPressEvent(int event_x, int event_y, int root_x, in if (isWheel) { if (!connection()->isAtLeastXI21()) { - // Logic borrowed from qapplication_x11.cpp - int delta = 120 * ((detail == 4 || detail == 6) ? 1 : -1); - bool hor = (((detail == 4 || detail == 5) - && (modifiers & Qt::AltModifier)) - || (detail == 6 || detail == 7)); - - QWindowSystemInterface::handleWheelEvent(window(), timestamp, - local, global, delta, hor ? Qt::Horizontal : Qt::Vertical, modifiers); + QPoint angleDelta; + if (detail == 4) + angleDelta.setY(120); + else if (detail == 5) + angleDelta.setY(-120); + else if (detail == 6) + angleDelta.setX(120); + else if (detail == 7) + angleDelta.setX(-120); + if (modifiers & Qt::AltModifier) + std::swap(angleDelta.rx(), angleDelta.ry()); + QWindowSystemInterface::handleWheelEvent(window(), timestamp, local, global, QPoint(), angleDelta, modifiers); } return; } |