From bd7624fdbfc4d263f95bb80736bdc9e442927d04 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Sun, 26 Jul 2020 18:07:56 +0200 Subject: [PATCH] tablet: transform coordinates according to the output transformations Uses the same code path we use for the mouse and touch, which was added after the tablet patches. --- libinput/connection.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libinput/connection.cpp b/libinput/connection.cpp index bc11d52bd3..e749405658 100644 --- a/libinput/connection.cpp +++ b/libinput/connection.cpp @@ -567,8 +567,14 @@ void Connection::processEvents() capabilities << InputRedirection::Wheel; } + const auto *output = static_cast( + kwinApp()->platform()->enabledOutputs()[tte->device()->screenId()]); + const QPointF globalPos = + devicePointToGlobalPosition(tte->transformedPosition(output->modeSize()), + output); + emit tabletToolEvent(tabletEventType, - tte->transformedPosition(m_size), tte->pressure(), + globalPos, tte->pressure(), tte->xTilt(), tte->yTilt(), tte->rotation(), tte->isTipDown(), tte->isNearby(), serial, toolId, toolType, capabilities, tte->time(),