diff options
| author | Horror Proton <107091537+horror-proton@users.noreply.github.com> | 2024-03-21 02:13:31 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-20 18:13:31 +0000 |
| commit | bfc95e992d460cbefe2c69de04da52e6089f6258 (patch) | |
| tree | 8fbf90601692cdbc279b65189b0531fa40544357 /src/managers/input/Swipe.cpp | |
| parent | d904f51716cf939772bf2bc581bcfb30fb7ed12b (diff) | |
swipe: fix nullptr in `onSwipeUpdate` (#5191)
Diffstat (limited to 'src/managers/input/Swipe.cpp')
| -rw-r--r-- | src/managers/input/Swipe.cpp | 4 |
1 files 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<Hyprlang::INT>("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); |
