summaryrefslogtreecommitdiff
path: root/src/managers/input/Touch.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-05-03 22:34:10 +0100
committerVaxry <vaxry@vaxry.net>2024-05-03 22:40:27 +0100
commit1237732b97fcf21a19aed16f2ef966118a3ca2aa (patch)
tree15a3a29377af7f0ce3dd428229587e476ce92db3 /src/managers/input/Touch.cpp
parent1d2acbe19355c8640d54a4b6cba225c6f4370c85 (diff)
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.
Diffstat (limited to 'src/managers/input/Touch.cpp')
-rw-r--r--src/managers/input/Touch.cpp7
1 files changed, 4 insertions, 3 deletions
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<Hyprlang::INT>("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;