summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
diff options
context:
space:
mode:
authorJohannes Zellner <johannes.zellner@nokia.com>2012-06-09 18:40:33 -0700
committerQt by Nokia <qt-info@nokia.com>2012-06-10 09:39:36 +0200
commit16548ce85ee29ad57f6948b262ce0dbcc99ab46d (patch)
tree85271340a3d36a7a02d8a6ca9cf565d1da06827d /src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
parent612fae1ae6299d9614b2af7efd122830c431240f (diff)
evdevmouse: send correct event position for wheel events
The current position for mouse events is synchronized in the mousemanager, thus the wheel event needs to pick the event position from there. Change-Id: I1e73a0154b596885c7092f0a74e6dd448deb428c Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Diffstat (limited to 'src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp')
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
index f1a86cb15a..d8e9586736 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
+++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
@@ -132,6 +132,16 @@ void QEvdevMouseManager::handleMouseEvent(int x, int y, Qt::MouseButtons buttons
#endif
}
+void QEvdevMouseManager::handleWheelEvent(int delta, Qt::Orientation orientation)
+{
+ QPoint pos(m_x + m_xoffset, m_y + m_yoffset);
+ QWindowSystemInterface::handleWheelEvent(0, pos, pos, delta, orientation);
+
+#ifdef QT_QPA_MOUSEMANAGER_DEBUG
+ qDebug("mouse wheel event %dx%d %d %d", pos.x(), pos.y(), delta, int(orientation));
+#endif
+}
+
void QEvdevMouseManager::addMouse(const QString &deviceNode)
{
#ifdef QT_QPA_MOUSEMANAGER_DEBUG
@@ -142,6 +152,7 @@ void QEvdevMouseManager::addMouse(const QString &deviceNode)
handler = QEvdevMouseHandler::create(deviceNode, m_spec);
if (handler) {
connect(handler, SIGNAL(handleMouseEvent(int, int, Qt::MouseButtons)), this, SLOT(handleMouseEvent(int, int, Qt::MouseButtons)));
+ connect(handler, SIGNAL(handleWheelEvent(int, Qt::Orientation)), this, SLOT(handleWheelEvent(int, Qt::Orientation)));
m_mice.insert(deviceNode, handler);
} else {
qWarning("Failed to open mouse");