diff options
author | Jeremy Katz <jeremy.katz@nokia.com> | 2010-05-10 13:43:29 (GMT) |
---|---|---|
committer | Jeremy Katz <jeremy.katz@nokia.com> | 2010-05-10 13:43:29 (GMT) |
commit | dcb472d839f41b29d3926c67c36e246a4e0049e0 (patch) | |
tree | cb344a8a2cec925191ccae30aaeb585db9d77434 | |
parent | 9b33f9c47cf5346404c54196b72d0b3b80f32454 (diff) | |
parent | b2e80f7525546b494543c902dbf8efb8b8609fc5 (diff) | |
download | Qt-dcb472d839f41b29d3926c67c36e246a4e0049e0.zip Qt-dcb472d839f41b29d3926c67c36e246a4e0049e0.tar.gz Qt-dcb472d839f41b29d3926c67c36e246a4e0049e0.tar.bz2 |
adjust mouse events for the screen's offset
-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; } |