From d7ef19e2e745c2184fcf5c2ce6ac4208d6a81594 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Thu, 6 Oct 2022 09:26:05 +0100 Subject: [PATCH] map touch to the correct output --- src/managers/input/Touch.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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();