summaryrefslogtreecommitdiff
path: root/src/managers/input/Swipe.cpp
diff options
context:
space:
mode:
authordavc0n <dconti.dev@gmail.com>2025-05-01 23:57:11 +0200
committerGitHub <noreply@github.com>2025-05-01 23:57:11 +0200
commit5b3e489108d8512fb5dfacf07b2aa3a71208e0f0 (patch)
tree658b5136c8994731d858eeaedc7a09518c86e010 /src/managers/input/Swipe.cpp
parent2670b8f7724e94020f21fe81483e69d73e1337cf (diff)
inputs: refactor class member vars (#10230)
Diffstat (limited to 'src/managers/input/Swipe.cpp')
-rw-r--r--src/managers/input/Swipe.cpp172
1 files changed, 86 insertions, 86 deletions
diff --git a/src/managers/input/Swipe.cpp b/src/managers/input/Swipe.cpp
index 62c0332a..f957c96e 100644
--- a/src/managers/input/Swipe.cpp
+++ b/src/managers/input/Swipe.cpp
@@ -33,11 +33,11 @@ void CInputManager::beginWorkspaceSwipe() {
Debug::log(LOG, "Starting a swipe from {}", PWORKSPACE->m_name);
- m_sActiveSwipe.pWorkspaceBegin = PWORKSPACE;
- m_sActiveSwipe.delta = 0;
- m_sActiveSwipe.pMonitor = g_pCompositor->m_lastMonitor;
- m_sActiveSwipe.avgSpeed = 0;
- m_sActiveSwipe.speedPoints = 0;
+ m_activeSwipe.pWorkspaceBegin = PWORKSPACE;
+ m_activeSwipe.delta = 0;
+ m_activeSwipe.pMonitor = g_pCompositor->m_lastMonitor;
+ m_activeSwipe.avgSpeed = 0;
+ m_activeSwipe.speedPoints = 0;
if (PWORKSPACE->m_hasFullscreenWindow) {
for (auto const& ls : g_pCompositor->m_lastMonitor->m_layerSurfaceLayers[2]) {
@@ -49,7 +49,7 @@ void CInputManager::beginWorkspaceSwipe() {
void CInputManager::onSwipeEnd(IPointer::SSwipeEndEvent e) {
EMIT_HOOK_EVENT_CANCELLABLE("swipeEnd", e);
- if (!m_sActiveSwipe.pWorkspaceBegin)
+ if (!m_activeSwipe.pWorkspaceBegin)
return; // no valid swipe
endWorkspaceSwipe();
}
@@ -61,7 +61,7 @@ void CInputManager::endWorkspaceSwipe() {
static auto PSWIPENEW = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_create_new");
static auto PSWIPEUSER = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_use_r");
static auto PWORKSPACEGAP = CConfigValue<Hyprlang::INT>("general:gaps_workspaces");
- const auto ANIMSTYLE = m_sActiveSwipe.pWorkspaceBegin->m_renderOffset->getStyle();
+ const auto ANIMSTYLE = m_activeSwipe.pWorkspaceBegin->m_renderOffset->getStyle();
const bool VERTANIMS = ANIMSTYLE == "slidevert" || ANIMSTYLE.starts_with("slidefadevert");
// commit
@@ -71,30 +71,30 @@ void CInputManager::endWorkspaceSwipe() {
// If we've been swiping off the right end with PSWIPENEW enabled, there is
// no workspace there yet, and we need to choose an ID for a new one now.
- if (workspaceIDRight <= m_sActiveSwipe.pWorkspaceBegin->m_id && *PSWIPENEW) {
+ if (workspaceIDRight <= m_activeSwipe.pWorkspaceBegin->m_id && *PSWIPENEW) {
workspaceIDRight = getWorkspaceIDNameFromString("r+1").id;
}
auto PWORKSPACER = g_pCompositor->getWorkspaceByID(workspaceIDRight); // not guaranteed if PSWIPENEW || PSWIPENUMBER
auto PWORKSPACEL = g_pCompositor->getWorkspaceByID(workspaceIDLeft); // not guaranteed if PSWIPENUMBER
- const auto RENDEROFFSETMIDDLE = m_sActiveSwipe.pWorkspaceBegin->m_renderOffset->value();
- const auto XDISTANCE = m_sActiveSwipe.pMonitor->m_size.x + *PWORKSPACEGAP;
- const auto YDISTANCE = m_sActiveSwipe.pMonitor->m_size.y + *PWORKSPACEGAP;
+ const auto RENDEROFFSETMIDDLE = m_activeSwipe.pWorkspaceBegin->m_renderOffset->value();
+ const auto XDISTANCE = m_activeSwipe.pMonitor->m_size.x + *PWORKSPACEGAP;
+ const auto YDISTANCE = m_activeSwipe.pMonitor->m_size.y + *PWORKSPACEGAP;
PHLWORKSPACE pSwitchedTo = nullptr;
- if ((abs(m_sActiveSwipe.delta) < SWIPEDISTANCE * *PSWIPEPERC && (*PSWIPEFORC == 0 || (*PSWIPEFORC != 0 && m_sActiveSwipe.avgSpeed < *PSWIPEFORC))) ||
- abs(m_sActiveSwipe.delta) < 2) {
+ if ((abs(m_activeSwipe.delta) < SWIPEDISTANCE * *PSWIPEPERC && (*PSWIPEFORC == 0 || (*PSWIPEFORC != 0 && m_activeSwipe.avgSpeed < *PSWIPEFORC))) ||
+ abs(m_activeSwipe.delta) < 2) {
// revert
- if (abs(m_sActiveSwipe.delta) < 2) {
+ if (abs(m_activeSwipe.delta) < 2) {
if (PWORKSPACEL)
PWORKSPACEL->m_renderOffset->setValueAndWarp(Vector2D(0, 0));
if (PWORKSPACER)
PWORKSPACER->m_renderOffset->setValueAndWarp(Vector2D(0, 0));
- m_sActiveSwipe.pWorkspaceBegin->m_renderOffset->setValueAndWarp(Vector2D(0, 0));
+ m_activeSwipe.pWorkspaceBegin->m_renderOffset->setValueAndWarp(Vector2D(0, 0));
} else {
- if (m_sActiveSwipe.delta < 0) {
+ if (m_activeSwipe.delta < 0) {
// to left
if (PWORKSPACEL) {
@@ -111,31 +111,31 @@ void CInputManager::endWorkspaceSwipe() {
*PWORKSPACER->m_renderOffset = Vector2D{XDISTANCE, 0.0};
}
- *m_sActiveSwipe.pWorkspaceBegin->m_renderOffset = Vector2D();
+ *m_activeSwipe.pWorkspaceBegin->m_renderOffset = Vector2D();
}
- pSwitchedTo = m_sActiveSwipe.pWorkspaceBegin;
- } else if (m_sActiveSwipe.delta < 0) {
+ pSwitchedTo = m_activeSwipe.pWorkspaceBegin;
+ } else if (m_activeSwipe.delta < 0) {
// switch to left
const auto RENDEROFFSET = PWORKSPACEL ? PWORKSPACEL->m_renderOffset->value() : Vector2D();
if (PWORKSPACEL)
- m_sActiveSwipe.pMonitor->changeWorkspace(workspaceIDLeft);
+ m_activeSwipe.pMonitor->changeWorkspace(workspaceIDLeft);
else {
- m_sActiveSwipe.pMonitor->changeWorkspace(g_pCompositor->createNewWorkspace(workspaceIDLeft, m_sActiveSwipe.pMonitor->m_id));
+ m_activeSwipe.pMonitor->changeWorkspace(g_pCompositor->createNewWorkspace(workspaceIDLeft, m_activeSwipe.pMonitor->m_id));
PWORKSPACEL = g_pCompositor->getWorkspaceByID(workspaceIDLeft);
- PWORKSPACEL->rememberPrevWorkspace(m_sActiveSwipe.pWorkspaceBegin);
+ PWORKSPACEL->rememberPrevWorkspace(m_activeSwipe.pWorkspaceBegin);
}
PWORKSPACEL->m_renderOffset->setValue(RENDEROFFSET);
PWORKSPACEL->m_alpha->setValueAndWarp(1.f);
- m_sActiveSwipe.pWorkspaceBegin->m_renderOffset->setValue(RENDEROFFSETMIDDLE);
+ m_activeSwipe.pWorkspaceBegin->m_renderOffset->setValue(RENDEROFFSETMIDDLE);
if (VERTANIMS)
- *m_sActiveSwipe.pWorkspaceBegin->m_renderOffset = Vector2D(0.0, YDISTANCE);
+ *m_activeSwipe.pWorkspaceBegin->m_renderOffset = Vector2D(0.0, YDISTANCE);
else
- *m_sActiveSwipe.pWorkspaceBegin->m_renderOffset = Vector2D(XDISTANCE, 0.0);
- m_sActiveSwipe.pWorkspaceBegin->m_alpha->setValueAndWarp(1.f);
+ *m_activeSwipe.pWorkspaceBegin->m_renderOffset = Vector2D(XDISTANCE, 0.0);
+ m_activeSwipe.pWorkspaceBegin->m_alpha->setValueAndWarp(1.f);
g_pInputManager->unconstrainMouse();
@@ -147,22 +147,22 @@ void CInputManager::endWorkspaceSwipe() {
const auto RENDEROFFSET = PWORKSPACER ? PWORKSPACER->m_renderOffset->value() : Vector2D();
if (PWORKSPACER)
- m_sActiveSwipe.pMonitor->changeWorkspace(workspaceIDRight);
+ m_activeSwipe.pMonitor->changeWorkspace(workspaceIDRight);
else {
- m_sActiveSwipe.pMonitor->changeWorkspace(g_pCompositor->createNewWorkspace(workspaceIDRight, m_sActiveSwipe.pMonitor->m_id));
+ m_activeSwipe.pMonitor->changeWorkspace(g_pCompositor->createNewWorkspace(workspaceIDRight, m_activeSwipe.pMonitor->m_id));
PWORKSPACER = g_pCompositor->getWorkspaceByID(workspaceIDRight);
- PWORKSPACER->rememberPrevWorkspace(m_sActiveSwipe.pWorkspaceBegin);
+ PWORKSPACER->rememberPrevWorkspace(m_activeSwipe.pWorkspaceBegin);
}
PWORKSPACER->m_renderOffset->setValue(RENDEROFFSET);
PWORKSPACER->m_alpha->setValueAndWarp(1.f);
- m_sActiveSwipe.pWorkspaceBegin->m_renderOffset->setValue(RENDEROFFSETMIDDLE);
+ m_activeSwipe.pWorkspaceBegin->m_renderOffset->setValue(RENDEROFFSETMIDDLE);
if (VERTANIMS)
- *m_sActiveSwipe.pWorkspaceBegin->m_renderOffset = Vector2D(0.0, -YDISTANCE);
+ *m_activeSwipe.pWorkspaceBegin->m_renderOffset = Vector2D(0.0, -YDISTANCE);
else
- *m_sActiveSwipe.pWorkspaceBegin->m_renderOffset = Vector2D(-XDISTANCE, 0.0);
- m_sActiveSwipe.pWorkspaceBegin->m_alpha->setValueAndWarp(1.f);
+ *m_activeSwipe.pWorkspaceBegin->m_renderOffset = Vector2D(-XDISTANCE, 0.0);
+ m_activeSwipe.pWorkspaceBegin->m_alpha->setValueAndWarp(1.f);
g_pInputManager->unconstrainMouse();
@@ -170,18 +170,18 @@ void CInputManager::endWorkspaceSwipe() {
pSwitchedTo = PWORKSPACER;
}
- m_sActiveSwipe.pWorkspaceBegin->rememberPrevWorkspace(pSwitchedTo);
+ m_activeSwipe.pWorkspaceBegin->rememberPrevWorkspace(pSwitchedTo);
- g_pHyprRenderer->damageMonitor(m_sActiveSwipe.pMonitor.lock());
+ g_pHyprRenderer->damageMonitor(m_activeSwipe.pMonitor.lock());
if (PWORKSPACEL)
PWORKSPACEL->m_forceRendering = false;
if (PWORKSPACER)
PWORKSPACER->m_forceRendering = false;
- m_sActiveSwipe.pWorkspaceBegin->m_forceRendering = false;
+ m_activeSwipe.pWorkspaceBegin->m_forceRendering = false;
- m_sActiveSwipe.pWorkspaceBegin = nullptr;
- m_sActiveSwipe.initialDirection = 0;
+ m_activeSwipe.pWorkspaceBegin = nullptr;
+ m_activeSwipe.initialDirection = 0;
g_pInputManager->refocus();
@@ -194,13 +194,13 @@ void CInputManager::endWorkspaceSwipe() {
void CInputManager::onSwipeUpdate(IPointer::SSwipeUpdateEvent e) {
EMIT_HOOK_EVENT_CANCELLABLE("swipeUpdate", e);
- if (!m_sActiveSwipe.pWorkspaceBegin)
+ if (!m_activeSwipe.pWorkspaceBegin)
return;
static auto PSWIPEINVR = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_invert");
- const auto ANIMSTYLE = m_sActiveSwipe.pWorkspaceBegin->m_renderOffset->getStyle();
+ const auto ANIMSTYLE = m_activeSwipe.pWorkspaceBegin->m_renderOffset->getStyle();
const bool VERTANIMS = ANIMSTYLE == "slidevert" || ANIMSTYLE.starts_with("slidefadevert");
- const double delta = m_sActiveSwipe.delta + (VERTANIMS ? (*PSWIPEINVR ? -e.delta.y : e.delta.y) : (*PSWIPEINVR ? -e.delta.x : e.delta.x));
+ const double delta = m_activeSwipe.delta + (VERTANIMS ? (*PSWIPEINVR ? -e.delta.y : e.delta.y) : (*PSWIPEINVR ? -e.delta.x : e.delta.x));
updateWorkspaceSwipe(delta);
}
@@ -214,66 +214,66 @@ void CInputManager::updateWorkspaceSwipe(double delta) {
static auto PWORKSPACEGAP = CConfigValue<Hyprlang::INT>("general:gaps_workspaces");
const auto SWIPEDISTANCE = std::clamp(*PSWIPEDIST, (int64_t)1LL, (int64_t)UINT32_MAX);
- const auto XDISTANCE = m_sActiveSwipe.pMonitor->m_size.x + *PWORKSPACEGAP;
- const auto YDISTANCE = m_sActiveSwipe.pMonitor->m_size.y + *PWORKSPACEGAP;
- const auto ANIMSTYLE = m_sActiveSwipe.pWorkspaceBegin->m_renderOffset->getStyle();
+ const auto XDISTANCE = m_activeSwipe.pMonitor->m_size.x + *PWORKSPACEGAP;
+ const auto YDISTANCE = m_activeSwipe.pMonitor->m_size.y + *PWORKSPACEGAP;
+ const auto ANIMSTYLE = m_activeSwipe.pWorkspaceBegin->m_renderOffset->getStyle();
const bool VERTANIMS = ANIMSTYLE == "slidevert" || ANIMSTYLE.starts_with("slidefadevert");
- const double d = m_sActiveSwipe.delta - delta;
- m_sActiveSwipe.delta = delta;
+ const double d = m_activeSwipe.delta - delta;
+ m_activeSwipe.delta = delta;
- m_sActiveSwipe.avgSpeed = (m_sActiveSwipe.avgSpeed * m_sActiveSwipe.speedPoints + abs(d)) / (m_sActiveSwipe.speedPoints + 1);
- m_sActiveSwipe.speedPoints++;
+ m_activeSwipe.avgSpeed = (m_activeSwipe.avgSpeed * m_activeSwipe.speedPoints + abs(d)) / (m_activeSwipe.speedPoints + 1);
+ m_activeSwipe.speedPoints++;
auto workspaceIDLeft = getWorkspaceIDNameFromString((*PSWIPEUSER ? "r-1" : "m-1")).id;
auto workspaceIDRight = getWorkspaceIDNameFromString((*PSWIPEUSER ? "r+1" : "m+1")).id;
- if ((workspaceIDLeft == WORKSPACE_INVALID || workspaceIDRight == WORKSPACE_INVALID || workspaceIDLeft == m_sActiveSwipe.pWorkspaceBegin->m_id) && !*PSWIPENEW) {
- m_sActiveSwipe.pWorkspaceBegin = nullptr; // invalidate the swipe
+ if ((workspaceIDLeft == WORKSPACE_INVALID || workspaceIDRight == WORKSPACE_INVALID || workspaceIDLeft == m_activeSwipe.pWorkspaceBegin->m_id) && !*PSWIPENEW) {
+ m_activeSwipe.pWorkspaceBegin = nullptr; // invalidate the swipe
return;
}
- m_sActiveSwipe.pWorkspaceBegin->m_forceRendering = true;
+ m_activeSwipe.pWorkspaceBegin->m_forceRendering = true;
- m_sActiveSwipe.delta = std::clamp(m_sActiveSwipe.delta, (double)-SWIPEDISTANCE, (double)SWIPEDISTANCE);
+ m_activeSwipe.delta = std::clamp(m_activeSwipe.delta, (double)-SWIPEDISTANCE, (double)SWIPEDISTANCE);
- if ((m_sActiveSwipe.pWorkspaceBegin->m_id == workspaceIDLeft && *PSWIPENEW && (m_sActiveSwipe.delta < 0)) ||
- (m_sActiveSwipe.delta > 0 && m_sActiveSwipe.pWorkspaceBegin->getWindows() == 0 && workspaceIDRight <= m_sActiveSwipe.pWorkspaceBegin->m_id) ||
- (m_sActiveSwipe.delta < 0 && m_sActiveSwipe.pWorkspaceBegin->m_id <= workspaceIDLeft)) {
+ if ((m_activeSwipe.pWorkspaceBegin->m_id == workspaceIDLeft && *PSWIPENEW && (m_activeSwipe.delta < 0)) ||
+ (m_activeSwipe.delta > 0 && m_activeSwipe.pWorkspaceBegin->getWindows() == 0 && workspaceIDRight <= m_activeSwipe.pWorkspaceBegin->m_id) ||
+ (m_activeSwipe.delta < 0 && m_activeSwipe.pWorkspaceBegin->m_id <= workspaceIDLeft)) {
- m_sActiveSwipe.delta = 0;
+ m_activeSwipe.delta = 0;
return;
}
if (*PSWIPEDIRLOCK) {
- if (m_sActiveSwipe.initialDirection != 0 && m_sActiveSwipe.initialDirection != (m_sActiveSwipe.delta < 0 ? -1 : 1))
- m_sActiveSwipe.delta = 0;
- else if (m_sActiveSwipe.initialDirection == 0 && abs(m_sActiveSwipe.delta) > *PSWIPEDIRLOCKTHRESHOLD)
- m_sActiveSwipe.initialDirection = m_sActiveSwipe.delta < 0 ? -1 : 1;
+ if (m_activeSwipe.initialDirection != 0 && m_activeSwipe.initialDirection != (m_activeSwipe.delta < 0 ? -1 : 1))
+ m_activeSwipe.delta = 0;
+ else if (m_activeSwipe.initialDirection == 0 && abs(m_activeSwipe.delta) > *PSWIPEDIRLOCKTHRESHOLD)
+ m_activeSwipe.initialDirection = m_activeSwipe.delta < 0 ? -1 : 1;
}
- if (m_sActiveSwipe.delta < 0) {
+ if (m_activeSwipe.delta < 0) {
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(workspaceIDLeft);
- if (workspaceIDLeft > m_sActiveSwipe.pWorkspaceBegin->m_id || !PWORKSPACE) {
+ if (workspaceIDLeft > m_activeSwipe.pWorkspaceBegin->m_id || !PWORKSPACE) {
if (*PSWIPENEW) {
- g_pHyprRenderer->damageMonitor(m_sActiveSwipe.pMonitor.lock());
+ g_pHyprRenderer->damageMonitor(m_activeSwipe.pMonitor.lock());
if (VERTANIMS)
- m_sActiveSwipe.pWorkspaceBegin->m_renderOffset->setValueAndWarp(Vector2D(0.0, ((-m_sActiveSwipe.delta) / SWIPEDISTANCE) * YDISTANCE));
+ m_activeSwipe.pWorkspaceBegin->m_renderOffset->setValueAndWarp(Vector2D(0.0, ((-m_activeSwipe.delta) / SWIPEDISTANCE) * YDISTANCE));
else
- m_sActiveSwipe.pWorkspaceBegin->m_renderOffset->setValueAndWarp(Vector2D(((-m_sActiveSwipe.delta) / SWIPEDISTANCE) * XDISTANCE, 0.0));
+ m_activeSwipe.pWorkspaceBegin->m_renderOffset->setValueAndWarp(Vector2D(((-m_activeSwipe.delta) / SWIPEDISTANCE) * XDISTANCE, 0.0));
- m_sActiveSwipe.pWorkspaceBegin->updateWindowDecos();
+ m_activeSwipe.pWorkspaceBegin->updateWindowDecos();
return;
}
- m_sActiveSwipe.delta = 0;
+ m_activeSwipe.delta = 0;
return;
}
PWORKSPACE->m_forceRendering = true;
PWORKSPACE->m_alpha->setValueAndWarp(1.f);
- if (workspaceIDLeft != workspaceIDRight && workspaceIDRight != m_sActiveSwipe.pWorkspaceBegin->m_id) {
+ if (workspaceIDLeft != workspaceIDRight && workspaceIDRight != m_activeSwipe.pWorkspaceBegin->m_id) {
const auto PWORKSPACER = g_pCompositor->getWorkspaceByID(workspaceIDRight);
if (PWORKSPACER) {
@@ -283,37 +283,37 @@ void CInputManager::updateWorkspaceSwipe(double delta) {
}
if (VERTANIMS) {
- PWORKSPACE->m_renderOffset->setValueAndWarp(Vector2D(0.0, ((-m_sActiveSwipe.delta) / SWIPEDISTANCE) * YDISTANCE - YDISTANCE));
- m_sActiveSwipe.pWorkspaceBegin->m_renderOffset->setValueAndWarp(Vector2D(0.0, ((-m_sActiveSwipe.delta) / SWIPEDISTANCE) * YDISTANCE));
+ PWORKSPACE->m_renderOffset->setValueAndWarp(Vector2D(0.0, ((-m_activeSwipe.delta) / SWIPEDISTANCE) * YDISTANCE - YDISTANCE));
+ m_activeSwipe.pWorkspaceBegin->m_renderOffset->setValueAndWarp(Vector2D(0.0, ((-m_activeSwipe.delta) / SWIPEDISTANCE) * YDISTANCE));
} else {
- PWORKSPACE->m_renderOffset->setValueAndWarp(Vector2D(((-m_sActiveSwipe.delta) / SWIPEDISTANCE) * XDISTANCE - XDISTANCE, 0.0));
- m_sActiveSwipe.pWorkspaceBegin->m_renderOffset->setValueAndWarp(Vector2D(((-m_sActiveSwipe.delta) / SWIPEDISTANCE) * XDISTANCE, 0.0));
+ PWORKSPACE->m_renderOffset->setValueAndWarp(Vector2D(((-m_activeSwipe.delta) / SWIPEDISTANCE) * XDISTANCE - XDISTANCE, 0.0));
+ m_activeSwipe.pWorkspaceBegin->m_renderOffset->setValueAndWarp(Vector2D(((-m_activeSwipe.delta) / SWIPEDISTANCE) * XDISTANCE, 0.0));
}
PWORKSPACE->updateWindowDecos();
} else {
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(workspaceIDRight);
- if (workspaceIDRight < m_sActiveSwipe.pWorkspaceBegin->m_id || !PWORKSPACE) {
+ if (workspaceIDRight < m_activeSwipe.pWorkspaceBegin->m_id || !PWORKSPACE) {
if (*PSWIPENEW) {
- g_pHyprRenderer->damageMonitor(m_sActiveSwipe.pMonitor.lock());
+ g_pHyprRenderer->damageMonitor(m_activeSwipe.pMonitor.lock());
if (VERTANIMS)
- m_sActiveSwipe.pWorkspaceBegin->m_renderOffset->setValueAndWarp(Vector2D(0.0, ((-m_sActiveSwipe.delta) / SWIPEDISTANCE) * YDISTANCE));
+ m_activeSwipe.pWorkspaceBegin->m_renderOffset->setValueAndWarp(Vector2D(0.0, ((-m_activeSwipe.delta) / SWIPEDISTANCE) * YDISTANCE));
else
- m_sActiveSwipe.pWorkspaceBegin->m_renderOffset->setValueAndWarp(Vector2D(((-m_sActiveSwipe.delta) / SWIPEDISTANCE) * XDISTANCE, 0.0));
+ m_activeSwipe.pWorkspaceBegin->m_renderOffset->setValueAndWarp(Vector2D(((-m_activeSwipe.delta) / SWIPEDISTANCE) * XDISTANCE, 0.0));
- m_sActiveSwipe.pWorkspaceBegin->updateWindowDecos();
+ m_activeSwipe.pWorkspaceBegin->updateWindowDecos();
return;
}
- m_sActiveSwipe.delta = 0;
+ m_activeSwipe.delta = 0;
return;
}
PWORKSPACE->m_forceRendering = true;
PWORKSPACE->m_alpha->setValueAndWarp(1.f);
- if (workspaceIDLeft != workspaceIDRight && workspaceIDLeft != m_sActiveSwipe.pWorkspaceBegin->m_id) {
+ if (workspaceIDLeft != workspaceIDRight && workspaceIDLeft != m_activeSwipe.pWorkspaceBegin->m_id) {
const auto PWORKSPACEL = g_pCompositor->getWorkspaceByID(workspaceIDLeft);
if (PWORKSPACEL) {
@@ -323,22 +323,22 @@ void CInputManager::updateWorkspaceSwipe(double delta) {
}
if (VERTANIMS) {
- PWORKSPACE->m_renderOffset->setValueAndWarp(Vector2D(0.0, ((-m_sActiveSwipe.delta) / SWIPEDISTANCE) * YDISTANCE + YDISTANCE));
- m_sActiveSwipe.pWorkspaceBegin->m_renderOffset->setValueAndWarp(Vector2D(0.0, ((-m_sActiveSwipe.delta) / SWIPEDISTANCE) * YDISTANCE));
+ PWORKSPACE->m_renderOffset->setValueAndWarp(Vector2D(0.0, ((-m_activeSwipe.delta) / SWIPEDISTANCE) * YDISTANCE + YDISTANCE));
+ m_activeSwipe.pWorkspaceBegin->m_renderOffset->setValueAndWarp(Vector2D(0.0, ((-m_activeSwipe.delta) / SWIPEDISTANCE) * YDISTANCE));
} else {
- PWORKSPACE->m_renderOffset->setValueAndWarp(Vector2D(((-m_sActiveSwipe.delta) / SWIPEDISTANCE) * XDISTANCE + XDISTANCE, 0.0));
- m_sActiveSwipe.pWorkspaceBegin->m_renderOffset->setValueAndWarp(Vector2D(((-m_sActiveSwipe.delta) / SWIPEDISTANCE) * XDISTANCE, 0.0));
+ PWORKSPACE->m_renderOffset->setValueAndWarp(Vector2D(((-m_activeSwipe.delta) / SWIPEDISTANCE) * XDISTANCE + XDISTANCE, 0.0));
+ m_activeSwipe.pWorkspaceBegin->m_renderOffset->setValueAndWarp(Vector2D(((-m_activeSwipe.delta) / SWIPEDISTANCE) * XDISTANCE, 0.0));
}
PWORKSPACE->updateWindowDecos();
}
- g_pHyprRenderer->damageMonitor(m_sActiveSwipe.pMonitor.lock());
+ g_pHyprRenderer->damageMonitor(m_activeSwipe.pMonitor.lock());
- m_sActiveSwipe.pWorkspaceBegin->updateWindowDecos();
+ m_activeSwipe.pWorkspaceBegin->updateWindowDecos();
if (*PSWIPEFOREVER) {
- if (abs(m_sActiveSwipe.delta) >= SWIPEDISTANCE) {
+ if (abs(m_activeSwipe.delta) >= SWIPEDISTANCE) {
onSwipeEnd({});
beginWorkspaceSwipe();
}