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 683948 - Add TapAction as subclass of GestureAction to deprecate ClickAction
Add TapAction as subclass of GestureAction to deprecate ClickAction
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: ClutterAction
git master
Other Linux
: Normal enhancement
: ---
Assigned To: clutter-maint
clutter-maint
Depends on: 685028 685221
Blocks:
 
 
Reported: 2012-09-13 11:58 UTC by Emanuele Aina
Modified: 2012-10-19 12:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tap-action: Add TapAction, to handle mouse/touch tapping (13.76 KB, patch)
2012-10-01 14:42 UTC, Emanuele Aina
none Details | Review
tap-action: Add TapAction, to handle mouse/touch tapping (13.68 KB, patch)
2012-10-05 11:12 UTC, Emanuele Aina
none Details | Review
tap-action: Add TapAction, to handle mouse/touch tapping (11.14 KB, patch)
2012-10-16 08:01 UTC, Emanuele Aina
accepted-commit_now Details | Review
tap-action: Add TapAction, to handle mouse/touch tapping (13.53 KB, patch)
2012-10-19 11:54 UTC, Emanuele Aina
committed Details | Review
tap-action: Add TapAction, to handle mouse/touch tapping (13.53 KB, patch)
2012-10-19 12:04 UTC, Emanuele Aina
committed Details | Review

Description Emanuele Aina 2012-09-13 11:58:24 UTC
ClickAction just got support for touch events, but it's support is not as sophisticated as the one from GestureAction (no multi touch support). ClickAction also lacks many accessors already provided by GestureAction (event sequence, event device, release coords, etc.)

A TapAction subclassing of GestureAction should replace ClickAction. Note that it would mean that GestureAction needs a way for subclassess to define a custom drag_threshold, as in this case it's meaning would be reversed: the action should start immediately and be *cancelled* if the threshold has been trespassed.
Comment 1 Emanuele Aina 2012-10-01 14:42:30 UTC
Created attachment 225498 [details] [review]
tap-action: Add TapAction, to handle mouse/touch tapping

TapAction is a GestureAction-subclass that handles clicks and
tap gestures. It is meant to provide a replacement for ClickAction
using GestureAction:

• building upon GestureAction the amount of code is greatly reduced;

• it does not capture events.

TapAction provides:

• tap signal, notifying users when a tap has been performed;

• threshold property, overriding the GestureAction::threshold property
  and using it as the maximum distance tolerated before cancelling the
  gesture.

The image-content example program has been updated replacing its
ClickAction usage with TapAction.
Comment 2 Emanuele Aina 2012-10-05 11:12:26 UTC
Created attachment 225870 [details] [review]
tap-action: Add TapAction, to handle mouse/touch tapping

Removed a debugging g_printf()
Comment 3 Emanuele Aina 2012-10-16 08:01:21 UTC
Created attachment 226527 [details] [review]
tap-action: Add TapAction, to handle mouse/touch tapping

TapAction is a GestureAction-subclass that handles clicks and
tap gestures. It is meant to provide a replacement for ClickAction
using GestureAction:

• it handles events trasparently without capturing them, so that it
  can coexists with other GestureActions;

• the ::tap signal is not emitted if the drag threshold is exceeded;

• building upon GestureAction the amount of code is greatly reduced.

TapAction provides:

• tap signal, notifying users when a tap has been performed.

The image-content example program has been updated replacing its
ClickAction usage with TapAction.
Comment 4 Emmanuele Bassi (:ebassi) 2012-10-19 09:03:13 UTC
Review of attachment 226527 [details] [review]:

looks good, with a couple of fixes.

you need to add the new functions to the clutter.symbols file, and you also need to update the API reference.

::: clutter/clutter-tap-action.c
@@ +47,3 @@
+ *   clutter_actor_add_action (actor, clutter_tap_action_new ());
+ *   clutter_actor_set_reactive (actor, TRUE);
+ *   g_signal_connect (actor, "tap", on_tap_callback);

you probably want to fix this example to make the code valid ;-)

@@ +88,3 @@
+             ClutterActor         *actor)
+{
+  emit_tap ((ClutterTapAction *)gesture, actor);

please, use the safe cast macro.
Comment 5 Emanuele Aina 2012-10-19 11:50:13 UTC
Add a dependency on #685221 because otherwise it is not possible to get ::tap events after a gesture has been cancelled (`priv->points->len' will grow indefinitely above `priv->requested_nb_points' blocking the emission of the ::gesture-end signal).
Comment 6 Emanuele Aina 2012-10-19 11:54:29 UTC
Created attachment 226813 [details] [review]
tap-action: Add TapAction, to handle mouse/touch tapping

Fix docs and list functions in clutter.symbols.
Comment 7 Emanuele Aina 2012-10-19 12:04:03 UTC
The following fix has been pushed:
61f2d75 tap-action: Add TapAction, to handle mouse/touch tapping
Comment 8 Emanuele Aina 2012-10-19 12:04:12 UTC
Created attachment 226816 [details] [review]
tap-action: Add TapAction, to handle mouse/touch tapping

TapAction is a GestureAction-subclass that handles clicks and
tap gestures. It is meant to provide a replacement for ClickAction
using GestureAction:

• it handles events trasparently without capturing them, so that it
  can coexists with other GestureActions;

• the ::tap signal is not emitted if the drag threshold is exceeded;

• building upon GestureAction the amount of code is greatly reduced.

TapAction provides:

• tap signal, notifying users when a tap has been performed.

The image-content example program has been updated replacing its
ClickAction usage with TapAction.