summaryrefslogtreecommitdiff
path: root/src/managers/input
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2022-11-03 13:34:06 +0000
committervaxerski <vaxry@vaxry.net>2022-11-03 13:35:34 +0000
commitd0e47d9fe09dfa3be0c46833bee832ddbe0fcb51 (patch)
tree4fd65c4fa0392264a782393de6e773d260b4beb7 /src/managers/input
parentf978368a4ef65d5af3de5d2fc56b72085fb5a8b8 (diff)
added workspace_swipe_forever
Diffstat (limited to 'src/managers/input')
-rw-r--r--src/managers/input/InputManager.hpp3
-rw-r--r--src/managers/input/Swipe.cpp12
2 files changed, 15 insertions, 0 deletions
diff --git a/src/managers/input/InputManager.hpp b/src/managers/input/InputManager.hpp
index 81f84c9b..a020fade 100644
--- a/src/managers/input/InputManager.hpp
+++ b/src/managers/input/InputManager.hpp
@@ -147,6 +147,9 @@ private:
wlr_surface* m_pFoundSurfaceToFocus = nullptr;
SLayerSurface* m_pFoundLSToFocus = nullptr;
CWindow* m_pFoundWindowToFocus = nullptr;
+
+ // swipe
+ void beginWorkspaceSwipe();
};
inline std::unique_ptr<CInputManager> g_pInputManager;
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