summaryrefslogtreecommitdiff
path: root/src/managers/input/Tablets.cpp
diff options
context:
space:
mode:
authorAntoine Dutot <antoine.dutot@gmail.com>2023-10-27 11:15:29 +0200
committerGitHub <noreply@github.com>2023-10-27 10:15:29 +0100
commit1d47e2c4088b74961fdc59aba558d84f4751fed1 (patch)
treee43f21a78082fe94083227a6e5f024f7c07e76dc /src/managers/input/Tablets.cpp
parent47256a6ed8fb486fd351834c85235a0672d69abc (diff)
input: fix force_zero_scaling for tablet and touch (#3644)
* Attempt to fix force_zero_scaling for tablet and touch for XWayland apps. * Formated using clang-format. * Simpler way to compute touch origin.
Diffstat (limited to 'src/managers/input/Tablets.cpp')
-rw-r--r--src/managers/input/Tablets.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/managers/input/Tablets.cpp b/src/managers/input/Tablets.cpp
index 77dd737c..e5968a5a 100644
--- a/src/managers/input/Tablets.cpp
+++ b/src/managers/input/Tablets.cpp
@@ -244,8 +244,6 @@ void CInputManager::focusTablet(STablet* pTab, wlr_tablet_tool* pTool, bool moti
if (const auto PWINDOW = g_pCompositor->m_pLastWindow; PWINDOW) {
const auto CURSORPOS = g_pInputManager->getMouseCoordsInternal();
- const auto LOCAL = CURSORPOS - PWINDOW->m_vRealPosition.goalv();
-
if (PTOOL->pSurface != g_pCompositor->m_pLastFocus)
wlr_tablet_v2_tablet_tool_notify_proximity_out(PTOOL->wlrTabletToolV2);
@@ -254,8 +252,14 @@ void CInputManager::focusTablet(STablet* pTab, wlr_tablet_tool* pTool, bool moti
wlr_tablet_v2_tablet_tool_notify_proximity_in(PTOOL->wlrTabletToolV2, pTab->wlrTabletV2, g_pCompositor->m_pLastFocus);
}
- if (motion)
- wlr_tablet_v2_tablet_tool_notify_motion(PTOOL->wlrTabletToolV2, LOCAL.x, LOCAL.y);
+ if (motion) {
+ auto local = CURSORPOS - PWINDOW->m_vRealPosition.goalv();
+
+ if (PWINDOW->m_bIsX11)
+ local = local * PWINDOW->m_fX11SurfaceScaledBy;
+
+ wlr_tablet_v2_tablet_tool_notify_motion(PTOOL->wlrTabletToolV2, local.x, local.y);
+ }
} else {
if (PTOOL->pSurface)
wlr_tablet_v2_tablet_tool_notify_proximity_out(PTOOL->wlrTabletToolV2);