summaryrefslogtreecommitdiff
path: root/src/managers/input/Touch.cpp
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2022-10-06 09:26:05 +0100
committervaxerski <vaxry@vaxry.net>2022-10-06 09:26:05 +0100
commitd7ef19e2e745c2184fcf5c2ce6ac4208d6a81594 (patch)
tree4e01fcc3964490520c0b2accf623aad4489c869e /src/managers/input/Touch.cpp
parent190ddb5697be20acacbfdcd6014c331deb397e36 (diff)
map touch to the correct output
Diffstat (limited to 'src/managers/input/Touch.cpp')
-rw-r--r--src/managers/input/Touch.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/managers/input/Touch.cpp b/src/managers/input/Touch.cpp
index c48f7473..d7b52171 100644
--- a/src/managers/input/Touch.cpp
+++ b/src/managers/input/Touch.cpp
@@ -2,7 +2,10 @@
#include "../../Compositor.hpp"
void CInputManager::onTouchDown(wlr_touch_down_event* e) {
- wlr_cursor_warp(g_pCompositor->m_sWLRCursor, g_pCompositor->m_sSeat.mouse->mouse, g_pCompositor->m_pLastMonitor->vecPosition.x + e->x * g_pCompositor->m_pLastMonitor->vecSize.x, g_pCompositor->m_pLastMonitor->vecPosition.y + e->y * g_pCompositor->m_pLastMonitor->vecSize.y);
+ auto PMONITOR = g_pCompositor->getMonitorFromName(e->touch->output_name ? e->touch->output_name : "");
+ PMONITOR = PMONITOR ? PMONITOR : g_pCompositor->m_pLastMonitor;
+
+ wlr_cursor_warp(g_pCompositor->m_sWLRCursor, g_pCompositor->m_sSeat.mouse->mouse, PMONITOR->vecPosition.x + e->x * PMONITOR->vecSize.x, PMONITOR->vecPosition.y + e->y * PMONITOR->vecSize.y);
refocus();