diff options
author | Jeremy Katz <jeremy.katz@nokia.com> | 2010-05-10 13:40:28 (GMT) |
---|---|---|
committer | Jeremy Katz <jeremy.katz@nokia.com> | 2010-05-10 13:40:28 (GMT) |
commit | b2e80f7525546b494543c902dbf8efb8b8609fc5 (patch) | |
tree | 84aafb3f67e1a0f544139c5abd3688d7a8887d13 /src/plugins | |
parent | e7918f5d940ca0a01bfe71e22e6aedcc2005b65f (diff) | |
download | Qt-b2e80f7525546b494543c902dbf8efb8b8609fc5.zip Qt-b2e80f7525546b494543c902dbf8efb8b8609fc5.tar.gz Qt-b2e80f7525546b494543c902dbf8efb8b8609fc5.tar.bz2 |
adjust mouse movement for the screen's offset
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/vnc/qvncserver.cpp | 7 |
1 files 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; } |