summaryrefslogtreecommitdiff
path: root/src/managers/input/Touch.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-05-24 22:19:22 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-05-24 22:19:22 +0200
commita2bb95fc60c717c873eff273f5ee035e622565d0 (patch)
tree7e023ad7bd7ffcbabc7cbc46f6b2f6d0ac5311aa /src/managers/input/Touch.cpp
parent12227d7b6a9e780a9d3747c0109e11377b1c07c6 (diff)
touch: fix double offset in local
Diffstat (limited to 'src/managers/input/Touch.cpp')
-rw-r--r--src/managers/input/Touch.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/managers/input/Touch.cpp b/src/managers/input/Touch.cpp
index 9f8f0e04..0826e384 100644
--- a/src/managers/input/Touch.cpp
+++ b/src/managers/input/Touch.cpp
@@ -39,8 +39,7 @@ void CInputManager::onTouchDown(wlr_touch_down_event* e) {
m_sTouchData.touchSurfaceOrigin = g_pInputManager->getMouseCoordsInternal() - local;
} else if (m_sTouchData.touchFocusLS) {
- local = g_pInputManager->getMouseCoordsInternal() - Vector2D(m_sTouchData.touchFocusLS->geometry.x, m_sTouchData.touchFocusLS->geometry.y) -
- g_pCompositor->m_pLastMonitor->vecPosition;
+ local = g_pInputManager->getMouseCoordsInternal() - Vector2D(m_sTouchData.touchFocusLS->geometry.x, m_sTouchData.touchFocusLS->geometry.y);
m_sTouchData.touchSurfaceOrigin = g_pInputManager->getMouseCoordsInternal() - local;
} else {
@@ -62,8 +61,7 @@ void CInputManager::onTouchMove(wlr_touch_motion_event* e) {
if (m_sTouchData.touchFocusWindow && g_pCompositor->windowValidMapped(m_sTouchData.touchFocusWindow)) {
const auto PMONITOR = g_pCompositor->getMonitorFromID(m_sTouchData.touchFocusWindow->m_iMonitorID);
- wlr_cursor_warp(g_pCompositor->m_sWLRCursor, nullptr, PMONITOR->vecPosition.x + e->x * PMONITOR->vecSize.x,
- PMONITOR->vecPosition.y + e->y * PMONITOR->vecSize.y);
+ wlr_cursor_warp(g_pCompositor->m_sWLRCursor, nullptr, PMONITOR->vecPosition.x + e->x * PMONITOR->vecSize.x, PMONITOR->vecPosition.y + e->y * PMONITOR->vecSize.y);
const auto local = g_pInputManager->getMouseCoordsInternal() - m_sTouchData.touchSurfaceOrigin;
@@ -72,8 +70,7 @@ void CInputManager::onTouchMove(wlr_touch_motion_event* e) {
} else if (m_sTouchData.touchFocusLS) {
const auto PMONITOR = g_pCompositor->getMonitorFromID(m_sTouchData.touchFocusLS->monitorID);
- wlr_cursor_warp(g_pCompositor->m_sWLRCursor, nullptr, PMONITOR->vecPosition.x + e->x * PMONITOR->vecSize.x,
- PMONITOR->vecPosition.y + e->y * PMONITOR->vecSize.y);
+ wlr_cursor_warp(g_pCompositor->m_sWLRCursor, nullptr, PMONITOR->vecPosition.x + e->x * PMONITOR->vecSize.x, PMONITOR->vecPosition.y + e->y * PMONITOR->vecSize.y);
const auto local = g_pInputManager->getMouseCoordsInternal() - m_sTouchData.touchSurfaceOrigin;