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 678279 - Add grab API on touch sequences
Add grab API on touch sequences
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks: 678278
 
 
Reported: 2012-06-18 01:28 UTC by Lionel Landwerlin
Modified: 2012-06-22 20:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch v1 (10.23 KB, patch)
2012-06-18 01:28 UTC, Lionel Landwerlin
accepted-commit_now Details | Review
patch v2 (9.74 KB, patch)
2012-06-20 19:47 UTC, Lionel Landwerlin
reviewed Details | Review
patch v3 (13.15 KB, patch)
2012-06-22 20:10 UTC, Lionel Landwerlin
accepted-commit_now Details | Review

Description Lionel Landwerlin 2012-06-18 01:28:04 UTC
Created attachment 216633 [details] [review]
patch v1

At the moment it is possible to grab a pointer input device. This is quite convinient for implement text selection for example. But, with multi touch devices, we need more granularity than just grabbing the whole device. We might want to just grab one of the touch point for the selection of text in a ClutterText, and grab another one at the same time from a different ClutterText actor.

Attached is a patch to implement this idea.
Comment 1 Emmanuele Bassi (:ebassi) 2012-06-20 08:59:33 UTC
Review of attachment 216633 [details] [review]:

looks generally okay; grabbing on the event sequence looks good. I wonder if we should add a ::grab-broken signal on ClutterActor, like GtkWidget has, to notify that a grab has been released, but that can be added later.

::: clutter/clutter-main.c
@@ +2337,3 @@
+    {
+      ClutterActor *grab_actor =
+    {

there's no need to cast the return value - g_hash_table_lookup() returns a void*

@@ +2845,3 @@
+{
+  ClutterEventSequence *sequence =
+    (ClutterEventSequence *) g_hash_table_lookup (device->inv_sequence_grab_actors,

same as above.

@@ +2848,3 @@
+                                                  actor);
+
+{

please, use an explicit != NULL.

@@ +3072,3 @@
+  else
+    {
+ */

no need to cast

@@ +3114,3 @@
+    return;
+
+    }

no need to cast

@@ +3156,3 @@
+    return NULL;
+
+ * @device: a #ClutterInputDevice

no need to cast
Comment 2 Lionel Landwerlin 2012-06-20 19:47:37 UTC
Created attachment 216867 [details] [review]
patch v2
Comment 3 Emmanuele Bassi (:ebassi) 2012-06-22 09:32:54 UTC
Review of attachment 216867 [details] [review]:

need to update the clutter.symbols and the API reference with the new methods on ClutterInputDevice.

::: clutter/clutter-main.c
@@ +3026,2 @@
 /**
+ * clutter_input_device_sequence_grab:

I would move the new ClutterInputDevice methods into clutter-input-device.c. the global grab/ungrap API being in clutter-main.c is an historical accident due to the fact that we didn't have ClutterInputDevice until later.
Comment 4 Lionel Landwerlin 2012-06-22 20:10:19 UTC
Created attachment 217046 [details] [review]
patch v3

Thanks a lot for the review.
Comment 5 Emmanuele Bassi (:ebassi) 2012-06-22 20:23:06 UTC
Review of attachment 217046 [details] [review]:

looks good