summaryrefslogtreecommitdiffstats
path: root/examples/wayland/minimal-cpp/compositor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/wayland/minimal-cpp/compositor.cpp')
-rw-r--r--examples/wayland/minimal-cpp/compositor.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/wayland/minimal-cpp/compositor.cpp b/examples/wayland/minimal-cpp/compositor.cpp
index fa9ae2da9..a4b989975 100644
--- a/examples/wayland/minimal-cpp/compositor.cpp
+++ b/examples/wayland/minimal-cpp/compositor.cpp
@@ -163,9 +163,13 @@ void Compositor::handleMouseMove(const QPoint &position)
defaultSeat()->sendMouseMoveEvent(view, mapToView(view, position));
}
-void Compositor::handleMouseWheel(Qt::Orientation orientation, int delta)
+void Compositor::handleMouseWheel(const QPoint &angleDelta)
{
- defaultSeat()->sendMouseWheelEvent(orientation, delta);
+ // TODO: fix this to send a single event, when diagonal scrolling is supported
+ if (angleDelta.x() != 0)
+ defaultSeat()->sendMouseWheelEvent(Qt::Horizontal, angleDelta.x());
+ if (angleDelta.y() != 0)
+ defaultSeat()->sendMouseWheelEvent(Qt::Vertical, angleDelta.y());
}
void Compositor::handleKeyPress(quint32 nativeScanCode)