Skip to content

Commit b039318

Browse files
committed
config: Fix multi-argument gesture dispatchers parsing
The `dispatcher` gesture handler used to only handle the first argument to the dispatcher, while some dispatchers (e.g., `sendshortcut`) want multiple arguments. This fixes `ConfigManager` to handle all the arguments provided to the dispatcher gesture handler. Fixes #11684.
1 parent 559024c commit b039318

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/config/ConfigManager.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3230,10 +3230,14 @@ std::optional<std::string> CConfigManager::handleGesture(const std::string& comm
32303230

32313231
std::expected<void, std::string> result;
32323232

3233-
if (data[startDataIdx] == "dispatcher")
3234-
result = g_pTrackpadGestures->addGesture(makeUnique<CDispatcherTrackpadGesture>(std::string{data[startDataIdx + 1]}, std::string{data[startDataIdx + 2]}), fingerCount,
3235-
direction, modMask, deltaScale);
3236-
else if (data[startDataIdx] == "workspace")
3233+
if (data[startDataIdx] == "dispatcher") {
3234+
auto dispatcherArgsIt = value.begin();
3235+
for (int i = 0; i < startDataIdx + 2; ++i) {
3236+
dispatcherArgsIt = std::find(dispatcherArgsIt, value.end(), ',') + 1;
3237+
}
3238+
result = g_pTrackpadGestures->addGesture(makeUnique<CDispatcherTrackpadGesture>(std::string{data[startDataIdx + 1]}, std::string(dispatcherArgsIt, value.end())),
3239+
fingerCount, direction, modMask, deltaScale);
3240+
} else if (data[startDataIdx] == "workspace")
32373241
result = g_pTrackpadGestures->addGesture(makeUnique<CWorkspaceSwipeGesture>(), fingerCount, direction, modMask, deltaScale);
32383242
else if (data[startDataIdx] == "resize")
32393243
result = g_pTrackpadGestures->addGesture(makeUnique<CResizeTrackpadGesture>(), fingerCount, direction, modMask, deltaScale);

0 commit comments

Comments
 (0)