From 1237732b97fcf21a19aed16f2ef966118a3ca2aa Mon Sep 17 00:00:00 2001 From: Vaxry Date: Fri, 3 May 2024 22:34:10 +0100 Subject: input: Introduce basic hyprland HID classes Implements an intermediary HID class for mice, keyboards and touch devices, removing the old structs from WLClasses.hpp Yes, virtual ones are duplicated a bit, but will likely be de-duped once wlr_input_device is not used anymore. --- src/managers/input/Touch.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/managers/input/Touch.cpp') diff --git a/src/managers/input/Touch.cpp b/src/managers/input/Touch.cpp index 91f4ada6..8f6e2226 100644 --- a/src/managers/input/Touch.cpp +++ b/src/managers/input/Touch.cpp @@ -2,6 +2,7 @@ #include "../../Compositor.hpp" #include "../../config/ConfigValue.hpp" #include "../../protocols/IdleNotify.hpp" +#include "../../devices/ITouch.hpp" void CInputManager::onTouchDown(wlr_touch_down_event* e) { static auto PSWIPETOUCH = CConfigValue("gestures:workspace_swipe_touch"); @@ -15,10 +16,10 @@ 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; }); + const auto PDEVIT = std::find_if(m_vTouches.begin(), m_vTouches.end(), [&](const auto& other) { return other->wlr() == e->touch; }); - if (PDEVIT != m_lTouchDevices.end() && !PDEVIT->boundOutput.empty()) - PMONITOR = g_pCompositor->getMonitorFromName(PDEVIT->boundOutput); + if (PDEVIT != m_vTouches.end() && !(*PDEVIT)->boundOutput.empty()) + PMONITOR = g_pCompositor->getMonitorFromName((*PDEVIT)->boundOutput); PMONITOR = PMONITOR ? PMONITOR : g_pCompositor->m_pLastMonitor; -- cgit v1.2.3