diff --git a/autotests/libinput/input_event_test.cpp b/autotests/libinput/input_event_test.cpp index e0ee2da48b..824bbc40d0 100644 --- a/autotests/libinput/input_event_test.cpp +++ b/autotests/libinput/input_event_test.cpp @@ -57,7 +57,6 @@ void InputEventsTest::testInitMouseEvent() // and verify the contract of QMouseEvent QCOMPARE(event.type(), type); QCOMPARE(event.globalPosition(), QPoint(100, 200)); - QCOMPARE(event.screenPos(), QPointF(100, 200)); QCOMPARE(event.position(), QPointF(100, 200)); QCOMPARE(event.button(), Qt::LeftButton); QCOMPARE(event.buttons(), Qt::LeftButton | Qt::RightButton); diff --git a/src/effect/offscreenquickview.cpp b/src/effect/offscreenquickview.cpp index a1139c1580..a9e74129d1 100644 --- a/src/effect/offscreenquickview.cpp +++ b/src/effect/offscreenquickview.cpp @@ -293,7 +293,7 @@ void OffscreenQuickView::forwardMouseEvent(QEvent *e) d->lastMousePressButton = me->button(); if (doubleClick) { d->lastMousePressButton = Qt::NoButton; - QMouseEvent doubleClickEvent(QEvent::MouseButtonDblClick, me->position(), me->windowPos(), me->screenPos(), me->button(), me->buttons(), me->modifiers()); + QMouseEvent doubleClickEvent(QEvent::MouseButtonDblClick, me->position(), me->globalPosition(), me->button(), me->buttons(), me->modifiers()); QCoreApplication::sendEvent(d->m_view.get(), &doubleClickEvent); } } diff --git a/src/input.cpp b/src/input.cpp index e15b262197..db34b38459 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -334,7 +334,7 @@ public: if (pointerSurfaceAllowed()) { // TODO: should the pointer position always stay in sync, i.e. not do the check? seat->setTimestamp(event->timestamp()); - seat->notifyPointerMotion(event->screenPos()); + seat->notifyPointerMotion(event->globalPosition()); } } else if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonRelease) { if (pointerSurfaceAllowed()) { @@ -639,7 +639,7 @@ public: } switch (event->type()) { case QEvent::MouseMove: - window->updateInteractiveMoveResize(event->screenPos(), input()->keyboardModifiers()); + window->updateInteractiveMoveResize(event->globalPosition(), input()->keyboardModifiers()); break; case QEvent::MouseButtonRelease: if (event->buttons() == Qt::NoButton) { @@ -1421,13 +1421,13 @@ public: if (!decoration) { return false; } - const QPointF globalPos = event->screenPos(); - const QPointF p = event->screenPos() - decoration->window()->pos(); + const QPointF globalPos = event->globalPosition(); + const QPointF p = event->globalPosition() - decoration->window()->pos(); switch (event->type()) { case QEvent::MouseMove: { QHoverEvent e(QEvent::HoverMove, p, p); QCoreApplication::instance()->sendEvent(decoration->decoration(), &e); - decoration->window()->processDecorationMove(p, event->screenPos()); + decoration->window()->processDecorationMove(p, event->globalPosition()); return true; } case QEvent::MouseButtonPress: @@ -1436,7 +1436,7 @@ public: if (actionResult) { return *actionResult; } - QMouseEvent e(event->type(), p, event->screenPos(), event->button(), event->buttons(), event->modifiers()); + QMouseEvent e(event->type(), p, event->globalPosition(), event->button(), event->buttons(), event->modifiers()); e.setTimestamp(std::chrono::duration_cast(event->timestamp()).count()); e.setAccepted(false); QCoreApplication::sendEvent(decoration->decoration(), &e);