diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-05-05 22:18:10 +0100 |
|---|---|---|
| committer | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2024-05-09 13:37:39 +0100 |
| commit | ed411f53bdcf8d455f9e6ca769693aa84dc8372f (patch) | |
| tree | aacedb349acdd1022975d7b622dc7cfe11388223 /src/managers/input/Swipe.cpp | |
| parent | e4e84064f2d07810e0c150bce1369a0a00503e9a (diff) | |
cursor: move to a hyprland impl
This moves wlr_cursor to a completely new impl mostly under
CPointerManager
Also adds beginSimple to OpenGL for simple render passes (e.g. cursor)
Diffstat (limited to 'src/managers/input/Swipe.cpp')
| -rw-r--r-- | src/managers/input/Swipe.cpp | 14 |
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(); } } |
