From bfc95e992d460cbefe2c69de04da52e6089f6258 Mon Sep 17 00:00:00 2001 From: Horror Proton <107091537+horror-proton@users.noreply.github.com> Date: Thu, 21 Mar 2024 02:13:31 +0800 Subject: [PATCH] swipe: fix nullptr in `onSwipeUpdate` (#5191) --- src/managers/input/Swipe.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/managers/input/Swipe.cpp b/src/managers/input/Swipe.cpp index 68f7aa25..5c3b7c28 100644 --- a/src/managers/input/Swipe.cpp +++ b/src/managers/input/Swipe.cpp @@ -195,11 +195,11 @@ void CInputManager::endWorkspaceSwipe() { } void CInputManager::onSwipeUpdate(wlr_pointer_swipe_update_event* e) { + if (!m_sActiveSwipe.pWorkspaceBegin) + return; static auto PSWIPEINVR = CConfigValue("gestures:workspace_swipe_invert"); const bool VERTANIMS = m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.getConfig()->pValues->internalStyle == "slidevert" || m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.getConfig()->pValues->internalStyle.starts_with("slidefadevert"); - if (!m_sActiveSwipe.pWorkspaceBegin) - return; const double delta = m_sActiveSwipe.delta + (VERTANIMS ? (*PSWIPEINVR ? -e->dy : e->dy) : (*PSWIPEINVR ? -e->dx : e->dx)); updateWorkspaceSwipe(delta);