summaryrefslogtreecommitdiff
path: root/src/managers/input/Swipe.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-11-22 16:01:02 +0000
committerVaxry <vaxry@vaxry.net>2024-11-22 16:01:02 +0000
commit745a82ce8ab19d958e344f5925bb1dc8ea7d6a53 (patch)
tree6ef992f0b52c5ca2492e248d5433f8edbc7cb1ba /src/managers/input/Swipe.cpp
parenta847bc67b1efcf3a0fa9c8a3a1da1a79743940c1 (diff)
core: workspace-related function cleanup / refactor
CCompositor is massive, and has a lot of functions that could be better optimized if in CWorkspace
Diffstat (limited to 'src/managers/input/Swipe.cpp')
-rw-r--r--src/managers/input/Swipe.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/managers/input/Swipe.cpp b/src/managers/input/Swipe.cpp
index ba0783fa..6cfe5a24 100644
--- a/src/managers/input/Swipe.cpp
+++ b/src/managers/input/Swipe.cpp
@@ -243,8 +243,7 @@ void CInputManager::updateWorkspaceSwipe(double delta) {
m_sActiveSwipe.delta = std::clamp(m_sActiveSwipe.delta, (double)-SWIPEDISTANCE, (double)SWIPEDISTANCE);
if ((m_sActiveSwipe.pWorkspaceBegin->m_iID == workspaceIDLeft && *PSWIPENEW && (m_sActiveSwipe.delta < 0)) ||
- (m_sActiveSwipe.delta > 0 && g_pCompositor->getWindowsOnWorkspace(m_sActiveSwipe.pWorkspaceBegin->m_iID) == 0 &&
- workspaceIDRight <= m_sActiveSwipe.pWorkspaceBegin->m_iID) ||
+ (m_sActiveSwipe.delta > 0 && m_sActiveSwipe.pWorkspaceBegin->getWindows() == 0 && workspaceIDRight <= m_sActiveSwipe.pWorkspaceBegin->m_iID) ||
(m_sActiveSwipe.delta < 0 && m_sActiveSwipe.pWorkspaceBegin->m_iID <= workspaceIDLeft)) {
m_sActiveSwipe.delta = 0;
@@ -270,7 +269,7 @@ void CInputManager::updateWorkspaceSwipe(double delta) {
else
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(Vector2D(((-m_sActiveSwipe.delta) / SWIPEDISTANCE) * XDISTANCE, 0.0));
- g_pCompositor->updateWorkspaceWindowDecos(m_sActiveSwipe.pWorkspaceBegin->m_iID);
+ m_sActiveSwipe.pWorkspaceBegin->updateWindowDecos();
return;
}
m_sActiveSwipe.delta = 0;
@@ -297,7 +296,7 @@ void CInputManager::updateWorkspaceSwipe(double delta) {
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(Vector2D(((-m_sActiveSwipe.delta) / SWIPEDISTANCE) * XDISTANCE, 0.0));
}
- g_pCompositor->updateWorkspaceWindowDecos(workspaceIDLeft);
+ PWORKSPACE->updateWindowDecos();
} else {
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(workspaceIDRight);
@@ -310,7 +309,7 @@ void CInputManager::updateWorkspaceSwipe(double delta) {
else
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(Vector2D(((-m_sActiveSwipe.delta) / SWIPEDISTANCE) * XDISTANCE, 0.0));
- g_pCompositor->updateWorkspaceWindowDecos(m_sActiveSwipe.pWorkspaceBegin->m_iID);
+ m_sActiveSwipe.pWorkspaceBegin->updateWindowDecos();
return;
}
m_sActiveSwipe.delta = 0;
@@ -337,12 +336,12 @@ void CInputManager::updateWorkspaceSwipe(double delta) {
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(Vector2D(((-m_sActiveSwipe.delta) / SWIPEDISTANCE) * XDISTANCE, 0.0));
}
- g_pCompositor->updateWorkspaceWindowDecos(workspaceIDRight);
+ PWORKSPACE->updateWindowDecos();
}
g_pHyprRenderer->damageMonitor(m_sActiveSwipe.pMonitor.lock());
- g_pCompositor->updateWorkspaceWindowDecos(m_sActiveSwipe.pWorkspaceBegin->m_iID);
+ m_sActiveSwipe.pWorkspaceBegin->updateWindowDecos();
if (*PSWIPEFOREVER) {
if (abs(m_sActiveSwipe.delta) >= SWIPEDISTANCE) {