summaryrefslogtreecommitdiff
path: root/src/managers/input/Swipe.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-04-03 19:20:47 +0100
committerVaxry <vaxry@vaxry.net>2024-04-03 19:20:47 +0100
commitd88d5898807bf6f2462cecfb977b7624dafbf52e (patch)
tree2400ebe96a53da8fed30d682c3894a51f290d797 /src/managers/input/Swipe.cpp
parent93915502d2677b70382b7cba09620b445f6b832e (diff)
swipe: add events
Diffstat (limited to 'src/managers/input/Swipe.cpp')
-rw-r--r--src/managers/input/Swipe.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/managers/input/Swipe.cpp b/src/managers/input/Swipe.cpp
index 47a6f5bd..ba91394e 100644
--- a/src/managers/input/Swipe.cpp
+++ b/src/managers/input/Swipe.cpp
@@ -7,6 +7,8 @@ void CInputManager::onSwipeBegin(wlr_pointer_swipe_begin_event* e) {
static auto PSWIPEFINGERS = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_fingers");
static auto PSWIPENEW = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_create_new");
+ EMIT_HOOK_EVENT_CANCELLABLE("swipeBegin", e);
+
if (e->fingers != *PSWIPEFINGERS || *PSWIPE == 0 || g_pSessionLockManager->isSessionLocked())
return;
@@ -42,6 +44,8 @@ void CInputManager::beginWorkspaceSwipe() {
}
void CInputManager::onSwipeEnd(wlr_pointer_swipe_end_event* e) {
+ EMIT_HOOK_EVENT_CANCELLABLE("swipeEnd", e);
+
if (!m_sActiveSwipe.pWorkspaceBegin)
return; // no valid swipe
endWorkspaceSwipe();
@@ -195,6 +199,8 @@ void CInputManager::endWorkspaceSwipe() {
}
void CInputManager::onSwipeUpdate(wlr_pointer_swipe_update_event* e) {
+ EMIT_HOOK_EVENT_CANCELLABLE("swipeUpdate", e);
+
if (!m_sActiveSwipe.pWorkspaceBegin)
return;
static auto PSWIPEINVR = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_invert");