summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbwindow.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-01-02 10:32:52 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-09 19:27:32 +0100
commit097b0a531642f79d8b240f89ca1eacca2ee59a5e (patch)
tree4beeffbb2ccf330e12c0028dbcaaf724ec4cc29e /src/plugins/platforms/xcb/qxcbwindow.cpp
parent8ca19dde556d4ec5a04d15af6d9985f2203ee4d5 (diff)
Use XInput2 scrolling events to enable smoother scrolling
With this patch all wheel events will be generated by XInput2 where available. This enables higher precision and smoother scrolling especially from input devices such as touchpads on laptops. [ChangeLog][Platform Specific Changes][X11 / XCB]Support XInput2 smooth scrolling events Change-Id: I3b069ed92ad5c53e08af64baaece32de82e9b5c4 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 81134ced49..407adc29ee 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -1689,6 +1689,7 @@ void QXcbWindow::handleButtonPressEvent(const xcb_button_press_event_t *event)
Qt::KeyboardModifiers modifiers = connection()->keyboard()->translateModifiers(event->state);
if (isWheel) {
+#ifndef XCB_USE_XINPUT21
// Logic borrowed from qapplication_x11.cpp
int delta = 120 * ((event->detail == 4 || event->detail == 6) ? 1 : -1);
bool hor = (((event->detail == 4 || event->detail == 5)
@@ -1697,6 +1698,7 @@ void QXcbWindow::handleButtonPressEvent(const xcb_button_press_event_t *event)
QWindowSystemInterface::handleWheelEvent(window(), event->time,
local, global, delta, hor ? Qt::Horizontal : Qt::Vertical, modifiers);
+#endif
return;
}