From ed411f53bdcf8d455f9e6ca769693aa84dc8372f Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sun, 5 May 2024 22:18:10 +0100 Subject: 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) --- src/managers/input/Swipe.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/managers/input/Swipe.cpp') 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("gestures:workspace_swipe"); static auto PSWIPEFINGERS = CConfigValue("gestures:workspace_swipe_fingers"); static auto PSWIPENEW = CConfigValue("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(); } } -- cgit v1.2.3