Skip to content

Commit

Permalink
swipe: fix nullptr in onSwipeUpdate (#5191)
Browse files Browse the repository at this point in the history
  • Loading branch information
horror-proton authored Mar 20, 2024
1 parent d904f51 commit bfc95e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/managers/input/Swipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bfc95e9

Please sign in to comment.