summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2012-05-19 12:26:23 +0300
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2012-05-20 16:13:19 +0200
commitc72be66c7f8a86ae835afe0ba0f2553b6aa3d54a (patch)
treef33cce53cded69cdb680c9696e6aa11be82088e9 /src
parent27249024b553215d0c7e297bfdc3c9367d625f47 (diff)
Make axis events compatible with Weston
From now on mouse wheel events will work both with qt-compositor and Weston. Change-Id: I54876cd45f3530ea9b4b7962ca52c0974e1cb2d5 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/compositor/wayland_wrapper/wlinputdevice.cpp2
-rw-r--r--src/plugins/platforms/wayland/qwaylandinputdevice.cpp6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/compositor/wayland_wrapper/wlinputdevice.cpp b/src/compositor/wayland_wrapper/wlinputdevice.cpp
index 10be24b69..a38057c98 100644
--- a/src/compositor/wayland_wrapper/wlinputdevice.cpp
+++ b/src/compositor/wayland_wrapper/wlinputdevice.cpp
@@ -263,7 +263,7 @@ void InputDevice::sendMouseWheelEvent(Qt::Orientation orientation, int delta)
uint32_t time = m_compositor->currentTimeMsecs();
uint32_t axis = orientation == Qt::Horizontal ? WL_POINTER_AXIS_HORIZONTAL_SCROLL
: WL_POINTER_AXIS_VERTICAL_SCROLL;
- wl_pointer_send_axis(resource, time, axis, delta);
+ wl_pointer_send_axis(resource, time, axis, delta / 120);
}
void InputDevice::sendKeyPressEvent(uint code)
diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp
index cbb922b12..f835eb23b 100644
--- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp
+++ b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp
@@ -338,10 +338,12 @@ void QWaylandInputDevice::pointer_axis(void *data,
QWaylandWindow *window = inputDevice->mPointerFocus;
Qt::Orientation orientation = axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL ? Qt::Horizontal
: Qt::Vertical;
- QWindowSystemInterface::handleWheelEvent(window->window(), time,
+ QWindowSystemInterface::handleWheelEvent(window->window(),
+ time,
inputDevice->mSurfacePos,
inputDevice->mGlobalPos,
- value, orientation);
+ value * 120,
+ orientation);
}
#ifndef QT_NO_WAYLAND_XKB