aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/managers/input/Swipe.cpp
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2022-11-03 13:34:06 +0000
committervaxerski <[email protected]>2022-11-03 13:35:34 +0000
commitd0e47d9fe09dfa3be0c46833bee832ddbe0fcb51 (patch)
tree4fd65c4fa0392264a782393de6e773d260b4beb7 /src/managers/input/Swipe.cpp
parentf978368a4ef65d5af3de5d2fc56b72085fb5a8b8 (diff)
downloadHyprland-d0e47d9fe09dfa3be0c46833bee832ddbe0fcb51.tar.gz
Hyprland-d0e47d9fe09dfa3be0c46833bee832ddbe0fcb51.zip
added workspace_swipe_forever
Diffstat (limited to 'src/managers/input/Swipe.cpp')
-rw-r--r--src/managers/input/Swipe.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/managers/input/Swipe.cpp b/src/managers/input/Swipe.cpp
index 1d462ccf..50763519 100644
--- a/src/managers/input/Swipe.cpp
+++ b/src/managers/input/Swipe.cpp
@@ -19,6 +19,10 @@ void CInputManager::onSwipeBegin(wlr_pointer_swipe_begin_event* e) {
if (onMonitor < 2 && !*PSWIPENEW)
return; // disallow swiping when there's 1 workspace on a monitor
+ beginWorkspaceSwipe();
+}
+
+void CInputManager::beginWorkspaceSwipe() {
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(g_pCompositor->m_pLastMonitor->activeWorkspace);
Debug::log(LOG, "Starting a swipe from %s", PWORKSPACE->m_szName.c_str());
@@ -162,6 +166,7 @@ void CInputManager::onSwipeUpdate(wlr_pointer_swipe_update_event* e) {
static auto *const PSWIPEDIST = &g_pConfigManager->getConfigValuePtr("gestures:workspace_swipe_distance")->intValue;
static auto *const PSWIPEINVR = &g_pConfigManager->getConfigValuePtr("gestures:workspace_swipe_invert")->intValue;
static auto *const PSWIPENEW = &g_pConfigManager->getConfigValuePtr("gestures:workspace_swipe_create_new")->intValue;
+ static auto *const PSWIPEFOREVER = &g_pConfigManager->getConfigValuePtr("gestures:workspace_swipe_forever")->intValue;
const bool VERTANIMS = m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.getConfig()->pValues->internalStyle == "slidevert";
@@ -258,4 +263,11 @@ void CInputManager::onSwipeUpdate(wlr_pointer_swipe_update_event* e) {
g_pHyprRenderer->damageMonitor(m_sActiveSwipe.pMonitor);
g_pCompositor->updateWorkspaceWindowDecos(m_sActiveSwipe.pWorkspaceBegin->m_iID);
+
+ if (*PSWIPEFOREVER) {
+ if (abs(m_sActiveSwipe.delta) >= *PSWIPEDIST) {
+ onSwipeEnd(nullptr);
+ beginWorkspaceSwipe();
+ }
+ }
} \ No newline at end of file