diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-05-07 22:29:43 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-07 22:29:43 +0100 |
| commit | 4c8c45d754c9956d611bbe373b3e33a7d5957d68 (patch) | |
| tree | ab5c800d548901b79da2e53f9a5393e96b909d4f /src/config | |
| parent | 39af3901b389f792a55176041dec9211c82ed1c9 (diff) | |
gestures: add scroll_move (#14063)
Diffstat (limited to 'src/config')
| -rw-r--r-- | src/config/legacy/ConfigManager.cpp | 5 | ||||
| -rw-r--r-- | src/config/lua/bindings/LuaBindingsConfigRules.cpp | 7 | ||||
| -rw-r--r-- | src/config/values/ConfigValues.cpp | 3 |
3 files changed, 11 insertions, 4 deletions
diff --git a/src/config/legacy/ConfigManager.cpp b/src/config/legacy/ConfigManager.cpp index 08bfe086..677202ce 100644 --- a/src/config/legacy/ConfigManager.cpp +++ b/src/config/legacy/ConfigManager.cpp @@ -57,6 +57,7 @@ #include "../../managers/input/trackpad/gestures/FloatGesture.hpp" #include "../../managers/input/trackpad/gestures/FullscreenGesture.hpp" #include "../../managers/input/trackpad/gestures/CursorZoomGesture.hpp" +#include "../../managers/input/trackpad/gestures/ScrollMoveGesture.hpp" #include "../../event/EventBus.hpp" @@ -1984,7 +1985,9 @@ std::optional<std::string> CConfigManager::handleGesture(const std::string& comm else if (data[startDataIdx] == "cursorZoom") { result = g_pTrackpadGestures->addGesture(makeUnique<CCursorZoomTrackpadGesture>(std::string{data[startDataIdx + 1]}, std::string{data[startDataIdx + 2]}), fingerCount, direction, modMask, deltaScale, disableInhibit); - } else if (data[startDataIdx] == "unset") + } else if (data[startDataIdx] == "scrollMove") + result = g_pTrackpadGestures->addGesture(makeUnique<CScrollMoveTrackpadGesture>(), fingerCount, direction, modMask, deltaScale, disableInhibit); + else if (data[startDataIdx] == "unset") result = g_pTrackpadGestures->removeGesture(fingerCount, direction, modMask, deltaScale, disableInhibit); else return std::format("Invalid gesture: {}", data[startDataIdx]); diff --git a/src/config/lua/bindings/LuaBindingsConfigRules.cpp b/src/config/lua/bindings/LuaBindingsConfigRules.cpp index 51548c04..44cf5607 100644 --- a/src/config/lua/bindings/LuaBindingsConfigRules.cpp +++ b/src/config/lua/bindings/LuaBindingsConfigRules.cpp @@ -38,6 +38,7 @@ #include "../../../managers/input/trackpad/gestures/ResizeGesture.hpp" #include "../../../managers/input/trackpad/gestures/SpecialWorkspaceGesture.hpp" #include "../../../managers/input/trackpad/gestures/WorkspaceSwipeGesture.hpp" +#include "../../../managers/input/trackpad/gestures/ScrollMoveGesture.hpp" #include "../../../managers/permissions/DynamicPermissionManager.hpp" #include <hyprutils/utils/ScopeGuard.hpp> @@ -721,7 +722,7 @@ static int hlWorkspaceRule(lua_State* L) { static int hlGesture(lua_State* L) { if (!lua_istable(L, 1)) - return Internal::configError(L, "hl.gesture: expected a table, e.g. { fingers = 3, direction = \"horizontal\", action = \"workspace\" }"); + return Internal::configError(L, R"(hl.gesture: expected a table, e.g. { fingers = 3, direction = "horizontal", action = "workspace" })"); CLuaConfigInt fingersParser(0, 2, 9); auto fingersErr = Internal::parseTableField(L, 1, "fingers", fingersParser); @@ -842,8 +843,10 @@ static int hlGesture(lua_State* L) { result = g_pTrackpadGestures->addGesture(makeUnique<CFloatTrackpadGesture>(mode), fingerCount, direction, modMask, deltaScale, disableInhibit); else if (action == "fullscreen") result = g_pTrackpadGestures->addGesture(makeUnique<CFullscreenTrackpadGesture>(mode), fingerCount, direction, modMask, deltaScale, disableInhibit); - else if (action == "cursorZoom") + else if (action == "cursor_zoom" || action == "cursorZoom") result = g_pTrackpadGestures->addGesture(makeUnique<CCursorZoomTrackpadGesture>(zoomLevel, mode), fingerCount, direction, modMask, deltaScale, disableInhibit); + else if (action == "scroll_move") + result = g_pTrackpadGestures->addGesture(makeUnique<CScrollMoveTrackpadGesture>(), fingerCount, direction, modMask, deltaScale, disableInhibit); else if (action == "unset") result = g_pTrackpadGestures->removeGesture(fingerCount, direction, modMask, deltaScale, disableInhibit); else diff --git a/src/config/values/ConfigValues.cpp b/src/config/values/ConfigValues.cpp index 73f2e9db..88269989 100644 --- a/src/config/values/ConfigValues.cpp +++ b/src/config/values/ConfigValues.cpp @@ -376,7 +376,8 @@ std::vector<SP<IValue>> Values::getConfigValues() { MS<Bool>("gestures:workspace_swipe_forever", "if enabled, swiping will not clamp at the neighboring workspaces but continue to the further ones.", false), MS<Bool>("gestures:workspace_swipe_use_r", "if enabled, swiping will use the r prefix instead of the m prefix for finding workspaces.", false), MS<Int>("gestures:close_max_timeout", "Timeout for closing windows with the close gesture, in ms.", 1000, {.min = 10, .max = 2000}), - + MS<Bool>("gestures:scrolling:move_snap_to_grid", "When releasing the scroll move gesture, whether it shoud try to snap to the grid.", true), + MS<Bool>("gestures:scrolling:move_snap_cursor", "When releasing the scroll move gesture, whether it shoud snap the cursor to the newly focused window.", true), /* * group: */ |
