Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-touch gestures for zoom/scroll/rotate #1178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brentyi
Copy link

@brentyi brentyi commented Mar 6, 2022

Hi!

Not sure if this project is still being maintained, but here's a basic+noninvasive implementation of gesture-based zoom/scroll/rotate operations that I've been using. Currently only enabled for the Freehand mode.

#427

gui/mode.py Outdated Show resolved Hide resolved
gui/mode.py Outdated Show resolved Hide resolved
gui/mode.py Outdated Show resolved Hide resolved
gui/mode.py Outdated Show resolved Hide resolved
@ChengduLittleA
Copy link

hummm interesting... will it break anything?

@brentyi
Copy link
Author

brentyi commented Mar 7, 2022

I haven't had any issues; the main caveat is that the current gesture implementation isn't compatible with modes that inherit from DragMode. There's probably a simple fix for that, but I don't know Gtk or the mypaint code well enough to say for sure. 🤷

@odysseywestra
Copy link
Member

Okay Appveyor is rebuilding the windows builds so you should be able to test it on windows too. Had a dependency issue that needed to be resolved.

@brentyi
Copy link
Author

brentyi commented Mar 20, 2022

Thanks @odysseywestra!

Not sure if/when I'll have time to revisit this, but some notes/updates for posterity:

  • I tested this in Windows, and the gesture itself works. But there's a minor issue where a click event (and thus a "dot" of paint) can be triggered at the end of the gesture.
  • I'd like to get gestures working for the "drag" modes, but there seems to be a fundamental incompatibility with the pointer grabs. I can get things working perfectly by commenting out the pointer_grab() and pointer_ungrab() calls, but it's not clear to me what that might break. Pointer grabs have been deprecated for a long time anyways, so maybe if this code is updated with current practices getting gestures working robustly will be much easier.
  • The current way my changes are set up, where the gesture events are attached/detached in the interaction mode enter/leave methods, doesn't make much sense when multiple interaction modes are stacked. But keeping things this way because pointer grabs from any of the DragMode subclasses break gesture events even after the pointer is ungrabbed; if the pointer grabs can be removed the gesture event handling can likely follow the same pattern as the scroll events.

@AesaraB AesaraB added this to the v2.02 milestone Jan 17, 2024
@AesaraB AesaraB linked an issue Jan 17, 2024 that may be closed by this pull request
@AesaraB AesaraB modified the milestones: v2.0.2, Graveyard: Overhauls Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add multi-touch support for zoom and scroll
5 participants