After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 685221 - Points get stuck in th tracking array when returning FALSE from ::gesture-progress
Points get stuck in th tracking array when returning FALSE from ::gesture-pro...
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: ClutterAction
unspecified
Other All
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks: 683948
 
 
Reported: 2012-10-01 15:34 UTC by Emanuele Aina
Modified: 2012-10-19 12:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gesture-action: unregister all tracked points on cancel (1.60 KB, patch)
2012-10-01 15:34 UTC, Emanuele Aina
committed Details | Review
gesture-action: Unregister all tracked points on cancel (1.60 KB, patch)
2012-10-19 12:03 UTC, Emanuele Aina
committed Details | Review

Description Emanuele Aina 2012-10-01 15:34:53 UTC
When a ::gesture-progress callback requests that the gesture should be cancelled by returning FALSE, GestureAction doesn't unregister the point but removes the stage_capture handler, causing the point to never leave the array. Subsequent gesture will have the wrong number of registered touchpoints and gesture_find_point() may return the original point for devices that lack a sequence identifier (eg. mouse).

The simplest solution is to empty the array tracking touch points in cancel_gesture(), which will make the gesture need a whole new set of touch points before being restarted.

Another solution may consist in calling gesture_unregister_point() for the event that causes the gesture to be cancelled: this will make eg. a three finger gesture restart by just releasing/pressing the finger that has caused the cancellation (provided that the other two finger are still pressed).
Comment 1 Emanuele Aina 2012-10-01 15:34:56 UTC
Created attachment 225502 [details] [review]
gesture-action: unregister all tracked points on cancel

Ensure that when cancelling a gesture, either because a callback
has returned FALSE or because clutter_gesture_action_cancel() has
been called, the array tracking touch points is emptied and a whole
new set of touch points is needed before restarting the gesture.
Comment 2 Emmanuele Bassi (:ebassi) 2012-10-10 14:39:42 UTC
(In reply to comment #0)
> Another solution may consist in calling gesture_unregister_point() for the
> event that causes the gesture to be cancelled: this will make eg. a three
> finger gesture restart by just releasing/pressing the finger that has caused
> the cancellation (provided that the other two finger are still pressed).

I don't think this is desirable: a gesture requiring N touch points should be cancelled when the effective number of touch points is less than N (and, arguably, more than N as well, though I'd have to check the semantics on other platforms for that). cancelling the gesture should reset its state, to allow other gestures to "pick up" the remaining touch points, e.g. you could have a three fingers action and a two fingers action, with the two fingers action acting as a fall back.
Comment 3 Emanuele Aina 2012-10-13 09:34:57 UTC
Yes, the "reset the whole state" is far simpler to understand (and implement), that's why the patch I sent does exactly that. Let me know if I should cook a patch to cancel actions when the active touchpoint grows above the requested number because it was in my TODO... :)
Comment 4 Emmanuele Bassi (:ebassi) 2012-10-19 11:59:58 UTC
Review of attachment 225502 [details] [review]:

looks good.
Comment 5 Emanuele Aina 2012-10-19 12:03:34 UTC
The following fix has been pushed:
bd1febb gesture-action: Unregister all tracked points on cancel
Comment 6 Emanuele Aina 2012-10-19 12:03:42 UTC
Created attachment 226815 [details] [review]
gesture-action: Unregister all tracked points on cancel

Ensure that when cancelling a gesture, either because a callback
has returned FALSE or because clutter_gesture_action_cancel() has
been called, the array tracking touch points is emptied and a whole
new set of touch points is needed before restarting the gesture.