diff options
| author | vaxerski <vaxry@vaxry.net> | 2022-10-14 12:38:44 +0100 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2022-10-14 12:38:44 +0100 |
| commit | 724fa4a7d44fe594109213b8a6f438e3539aa332 (patch) | |
| tree | 840651e65089da97f581896821ed41fc24d778f1 /src/managers/input/Touch.cpp | |
| parent | cee0645fd1e8f84438635483fd17007c077812fe (diff) | |
add touch binding to output
Diffstat (limited to 'src/managers/input/Touch.cpp')
| -rw-r--r-- | src/managers/input/Touch.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/managers/input/Touch.cpp b/src/managers/input/Touch.cpp index d7b52171..e140d8a1 100644 --- a/src/managers/input/Touch.cpp +++ b/src/managers/input/Touch.cpp @@ -3,6 +3,12 @@ void CInputManager::onTouchDown(wlr_touch_down_event* e) { auto PMONITOR = g_pCompositor->getMonitorFromName(e->touch->output_name ? e->touch->output_name : ""); + + const auto PDEVIT = std::find_if(m_lTouchDevices.begin(), m_lTouchDevices.end(), [&](const STouchDevice& other) { return other.pWlrDevice == &e->touch->base; }); + + if (PDEVIT != m_lTouchDevices.end() && !PDEVIT->boundOutput.empty()) + PMONITOR = g_pCompositor->getMonitorFromName(PDEVIT->boundOutput); + 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); |
