From 10eb1aa0b92dad94065fd5e246629d4b6b45c8ec Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Mon, 25 Oct 2021 16:53:13 +0200 Subject: [PATCH] SeatInterface: Expose firstTouchPointPosition This exposes "globalTouch.focus.firstTouchPos" so other things can use it in place of "pointerPos" when touch is being used. --- src/wayland/seat_interface.cpp | 5 +++++ src/wayland/seat_interface.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/wayland/seat_interface.cpp b/src/wayland/seat_interface.cpp index ae4f173214..ca614986d3 100644 --- a/src/wayland/seat_interface.cpp +++ b/src/wayland/seat_interface.cpp @@ -1005,6 +1005,11 @@ TouchInterface *SeatInterface::touch() const return d->touch.data(); } +QPointF SeatInterface::firstTouchPointPosition() const +{ + return d->globalTouch.focus.firstTouchPos; +} + void SeatInterface::setFocusedTouchSurface(SurfaceInterface *surface, const QPointF &surfacePosition) { if (!d->touch) { diff --git a/src/wayland/seat_interface.h b/src/wayland/seat_interface.h index 6bd2d0c933..da626e2fbd 100644 --- a/src/wayland/seat_interface.h +++ b/src/wayland/seat_interface.h @@ -582,6 +582,7 @@ public: void notifyTouchFrame(); void notifyTouchCancel(); bool isTouchSequence() const; + QPointF firstTouchPointPosition() const; /** * @returns true if there is a touch sequence going on associated with a touch * down of the given @p serial.