summaryrefslogtreecommitdiff
path: root/src/managers/input/Swipe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/managers/input/Swipe.cpp')
-rw-r--r--src/managers/input/Swipe.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/managers/input/Swipe.cpp b/src/managers/input/Swipe.cpp
index 8c489af5..63adc8ca 100644
--- a/src/managers/input/Swipe.cpp
+++ b/src/managers/input/Swipe.cpp
@@ -2,14 +2,14 @@
#include "../../Compositor.hpp"
#include "../../config/ConfigValue.hpp"
-void CInputManager::onSwipeBegin(wlr_pointer_swipe_begin_event* e) {
+void CInputManager::onSwipeBegin(IPointer::SSwipeBeginEvent e) {
static auto PSWIPE = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe");
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())
+ if (e.fingers != *PSWIPEFINGERS || *PSWIPE == 0 || g_pSessionLockManager->isSessionLocked())
return;
int onMonitor = 0;
@@ -32,7 +32,7 @@ void CInputManager::beginWorkspaceSwipe() {
m_sActiveSwipe.pWorkspaceBegin = PWORKSPACE;
m_sActiveSwipe.delta = 0;
- m_sActiveSwipe.pMonitor = g_pCompositor->m_pLastMonitor;
+ m_sActiveSwipe.pMonitor = g_pCompositor->m_pLastMonitor.get();
m_sActiveSwipe.avgSpeed = 0;
m_sActiveSwipe.speedPoints = 0;
@@ -43,7 +43,7 @@ void CInputManager::beginWorkspaceSwipe() {
}
}
-void CInputManager::onSwipeEnd(wlr_pointer_swipe_end_event* e) {
+void CInputManager::onSwipeEnd(IPointer::SSwipeEndEvent e) {
EMIT_HOOK_EVENT_CANCELLABLE("swipeEnd", e);
if (!m_sActiveSwipe.pWorkspaceBegin)
@@ -198,7 +198,7 @@ void CInputManager::endWorkspaceSwipe() {
}
}
-void CInputManager::onSwipeUpdate(wlr_pointer_swipe_update_event* e) {
+void CInputManager::onSwipeUpdate(IPointer::SSwipeUpdateEvent e) {
EMIT_HOOK_EVENT_CANCELLABLE("swipeUpdate", e);
if (!m_sActiveSwipe.pWorkspaceBegin)
@@ -207,7 +207,7 @@ void CInputManager::onSwipeUpdate(wlr_pointer_swipe_update_event* e) {
const bool VERTANIMS = m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.getConfig()->pValues->internalStyle == "slidevert" ||
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.getConfig()->pValues->internalStyle.starts_with("slidefadevert");
- const double delta = m_sActiveSwipe.delta + (VERTANIMS ? (*PSWIPEINVR ? -e->dy : e->dy) : (*PSWIPEINVR ? -e->dx : e->dx));
+ const double delta = m_sActiveSwipe.delta + (VERTANIMS ? (*PSWIPEINVR ? -e.delta.y : e.delta.y) : (*PSWIPEINVR ? -e.delta.x : e.delta.x));
updateWorkspaceSwipe(delta);
}
@@ -348,7 +348,7 @@ void CInputManager::updateWorkspaceSwipe(double delta) {
if (*PSWIPEFOREVER) {
if (abs(m_sActiveSwipe.delta) >= SWIPEDISTANCE) {
- onSwipeEnd(nullptr);
+ onSwipeEnd({});
beginWorkspaceSwipe();
}
}