Skip to content

Make Gestures bindings independent per button - #170

Open
asdolo wants to merge 1 commit into
mmaher88:masterfrom
asdolo:feat/per-button-gestures
Open

asdolo wants to merge 1 commit into
mmaher88:masterfrom
asdolo:feat/per-button-gestures

Conversation

@asdolo

@asdolo asdolo commented Oct 25, 2026

Copy link
Copy Markdown

Summary

  • Each button assigned Gestures keeps its own up/down/left/right/click map (Options+-style), instead of one shared profile-wide Gestures section.
  • Legacy flat [Gestures] profiles migrate by copying the shared map onto every gesture-trigger button.
  • Assigning Gestures to a button for the first time seeds that button from device defaultGestures.

Test plan

  • Assign Gestures to two buttons; change a direction on one — the other must stay unchanged
  • Restart app / reload profile — per-button bindings persist under [Gestures/<buttonIndex>/…]
  • Open an older profile with flat [Gestures] keys — both gesture buttons still work, then diverge after editing
  • logitune-tests filters for *Gesture*, ProfileEngine.*, DeviceModelTest.*Gesture* pass

Each gesture-trigger button keeps its own direction map (Options+-style)
instead of sharing one profile-wide Gestures section.

@mmaher88 mmaher88 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this closes #122 nicely, and the migration from the old flat [Gestures] keys and its tests are solid. Since #174 landed, a few things need attention on rebase:

  1. ButtonActionDispatcher.cpp merges without a git conflict but still uses m_currentDevice, which no longer exists. Instead of looking up a descriptor on release, please record the button index in the per-device state when the gesture button is pressed and use that.
  2. In setupProfileForDevice, seed from the connecting device's descriptor, not m_currentDevice.
  3. Update tests/test_device_routing.cpp, which still uses .gestures.
  4. In saveCurrentProfile, move p.buttonGestures.clear() inside the m_currentDevice guard, so a save without a descriptor can't wipe every map.

For downgrades, could you keep writing the flat [Gestures] keys (mirroring the lowest gesture button) for a release or two? Older builds would then keep working instead of erasing the nested keys on their next save. If #168 merges first, please route its drag path through the same per-button lookup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants