From b2e80f7525546b494543c902dbf8efb8b8609fc5 Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Mon, 10 May 2010 15:40:28 +0200 Subject: adjust mouse movement for the screen's offset --- src/plugins/platforms/vnc/qvncserver.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/vnc/qvncserver.cpp b/src/plugins/platforms/vnc/qvncserver.cpp index bd4d6ab..6424083 100644 --- a/src/plugins/platforms/vnc/qvncserver.cpp +++ b/src/plugins/platforms/vnc/qvncserver.cpp @@ -836,7 +836,8 @@ void QVNCServer::pointerEvent() // const QPoint offset = qvnc_screen->offset(); // QWSServer::sendMouseEvent(offset + QPoint(ev.x, ev.y), ev.buttons); - + QPoint eventPoint(ev.x, ev.y); + eventPoint += screen()->geometry().topLeft(); //qDebug() << "pointerEvent" << ev.x << ev.y << hex << ev.buttons; if (ev.wheelDirection == ev.WheelNone) { QEvent::Type type = QEvent::MouseMove; @@ -844,7 +845,7 @@ void QVNCServer::pointerEvent() bool isPress; if (buttonChange(buttons, ev.buttons, &button, &isPress)) type = isPress ? QEvent::MouseButtonPress : QEvent::MouseButtonRelease; - QWindowSystemInterface::handleMouseEvent(0, QPoint(ev.x, ev.y), QPoint(ev.x, ev.y), ev.buttons); + QWindowSystemInterface::handleMouseEvent(0, eventPoint, eventPoint, ev.buttons); } else { // No buttons or motion reported at the same time as wheel events Qt::Orientation orientation; @@ -853,7 +854,7 @@ void QVNCServer::pointerEvent() else orientation = Qt::Vertical; int delta = 120 * ((ev.wheelDirection == ev.WheelLeft || ev.wheelDirection == ev.WheelUp) ? 1 : -1); - QWindowSystemInterface::handleWheelEvent(0, QPoint(ev.x, ev.y), QPoint(ev.x, ev.y), delta, orientation); + QWindowSystemInterface::handleWheelEvent(0, eventPoint, eventPoint, delta, orientation); } handleMsg = false; } -- cgit v0.12