diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-12-20 09:31:04 +0100 |
---|---|---|
committer | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-12-30 12:33:29 +0100 |
commit | 957c0f52de83a0efe75b0ab33d1645799b892725 (patch) | |
tree | bff0e3d7e0c0fec62ee8037beafd92e5fd5d0821 /src/client/qwaylandinputdevice.cpp | |
parent | 4b2376e850d5030f73fd9e8e03ebf07922e1361b (diff) |
Client: Add QWaylandWindow::mapFromWlSurface
Qt window coordinates start inside the decorations, while wl_surface
coordinates start at the first pixel of the buffer. Potentially, that would be
in the shadow, although we don't have those. So for now, it's the first pixel
of the decorations.
Change-Id: Idccf8a359035f5477d6bc9e2e03a0e9fafe16971
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
Diffstat (limited to 'src/client/qwaylandinputdevice.cpp')
-rw-r--r-- | src/client/qwaylandinputdevice.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index 3f0d61d6a..8f23805de 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -1408,8 +1408,7 @@ void QWaylandInputDevice::handleTouchPoint(int id, Qt::TouchPointState state, co return; tp.area = QRectF(0, 0, 8, 8); - QMargins margins = win->frameMargins(); - QPointF localPosition = surfacePosition - QPointF(margins.left(), margins.top()); + QPointF localPosition = win->mapFromWlSurface(surfacePosition); // TODO: This doesn't account for high dpi scaling for the delta, but at least it matches // what we have for mouse input. QPointF delta = localPosition - localPosition.toPoint(); |