diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2012-05-19 12:26:23 +0300 |
---|---|---|
committer | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2012-05-20 16:13:19 +0200 |
commit | c72be66c7f8a86ae835afe0ba0f2553b6aa3d54a (patch) | |
tree | f33cce53cded69cdb680c9696e6aa11be82088e9 /src | |
parent | 27249024b553215d0c7e297bfdc3c9367d625f47 (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.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/qwaylandinputdevice.cpp | 6 |
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 |