Merge lp:~ilidrissi.amine/gesturetest/621600-no-args into lp:gesturetest

Proposed by Mohamed Amine Ilidrissi
Status: Rejected
Rejected by: Chase Douglas
Proposed branch: lp:~ilidrissi.amine/gesturetest/621600-no-args
Merge into: lp:gesturetest
Diff against target: 94 lines (+48/-36)
1 file modified
src/main.c (+48/-36)
To merge this branch: bzr merge lp:~ilidrissi.amine/gesturetest/621600-no-args
Reviewer Review Type Date Requested Status
Chase Douglas (community) Approve
Henrik Rydberg (community) Approve
Review via email: mp+36641@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Henrik Rydberg (rydberg) wrote :

Looks ok to me.

review: Approve
Revision history for this message
Chase Douglas (chasedouglas) wrote :

I'm sorry I haven't gotten back to this sooner, but I'm against this change. gesturetest is not a demo program that you run to see things fly across your screen when you perform gestures :). It's a test tool that must be used in specific ways to get the results you want to see.

For example, if you are interested in testing rotation gestures, you should subscribe only to them and not to other gestures. As soon as you start to listen for other gestures things get very confusing. It can be hard to understand why you might be receiving drag gestures when you perform a pivot rotation, and subscribing to all gestures by default only exacerbates the issue. Essentially, I don't want people to run gesturetest and make decisions based on poor testing scenarios.

review: Disapprove
Revision history for this message
Mohamed Amine Ilidrissi (ilidrissi.amine) wrote :

So, for example, if a program listens to 2 different gestures at the same time (if it's waiting for the user to do something for example), those 2 gestures can collide, confusing the user? If so, shouldn't that be fixed?
(Just asking ; I don't know anything about gestures :p)

Revision history for this message
Chase Douglas (chasedouglas) wrote :

I'll give an example that caused us issues. If you want to perform a rotation where one finger pivots around another, you will receive both rotation and drag events. The reason is that gestures are performed about a point in space. Our gesture system uses the center (average) of all the touch points as this "focus" point. So if you perform a pivot rotation, you'll see the focus point being rotated, but you'll also see it being dragged. This is the correct behavior, but it isn't obvious.

We had a bug filed against our recognizer where the user didn't expect to see drag events when performing a pivot rotation. What they should have done is subscribed to just the rotate gesture events, since all they cared about was the rotation. I don't want to lead people to assume our stack is broken because they ran gesturetest without any arguments and saw behavior they didn't understand. Thus, I want to keep the functionality as is, potentially requiring the user to read the man page to understand what gesturetest is really doing.

Revision history for this message
Mohamed Amine Ilidrissi (ilidrissi.amine) wrote :

> I'll give an example that caused us issues. If you want to perform a rotation
> where one finger pivots around another, you will receive both rotation and
> drag events. The reason is that gestures are performed about a point in space.
> Our gesture system uses the center (average) of all the touch points as this
> "focus" point. So if you perform a pivot rotation, you'll see the focus point
> being rotated, but you'll also see it being dragged. This is the correct
> behavior, but it isn't obvious.
>
> We had a bug filed against our recognizer where the user didn't expect to see
> drag events when performing a pivot rotation. What they should have done is
> subscribed to just the rotate gesture events, since all they cared about was
> the rotation. I don't want to lead people to assume our stack is broken
> because they ran gesturetest without any arguments and saw behavior they
> didn't understand. Thus, I want to keep the functionality as is, potentially
> requiring the user to read the man page to understand what gesturetest is
> really doing.

Would an "--all-gestures" option do the trick? That way, the user knows that he is testing all the gestures at once.

Revision history for this message
Henrik Rydberg (rydberg) wrote :

I think the reasons for not including this change are really small. What you gain is the ability to see that *something* comes through in an easy way. For most people, that is that only thing they care about.

Regarding the completely different matter of rotation pivot, that bug is still valid, and the reasons for not confusing the center of the contacts with the pivot are still there. In the future, we will most likely see no drag events as one performs a rotation around a single finger, even if both types of events are listened to.

Revision history for this message
Chase Douglas (chasedouglas) wrote :

I guess my underlying question is why we need this functionality. It seems to me that what we really need is a demo to show that gestures are working. Something graphical that you can manipulate. Gesturetest is not intended to show an end user that gestures are working properly. It is merely a developer's tool. This feels like trying to fit a round peg into a square hole.

Also, note that gesturetest will be dropped after Maverick anyways since gesture recognition will be performed client side instead of inside X. Geistest really is the utility you are after :).

Revision history for this message
Henrik Rydberg (rydberg) wrote :

Geistest is one layer further away from the source, and there are reasons to be able to test the presence of events on several checkpoints, this one included. And geistest would not be any easier to use with the same line of reasoning.

Revision history for this message
Chase Douglas (chasedouglas) wrote :

I still disagree as I think this may lead to sloppy coding. For example, adding 0 as a window parameter to gesturetest to listen on all windows has already led to an improper implementation of gestures in Unity. Unity currently listens for window specific gestures on all windows, including root, and uses the focus point to choose the correct window for manipulation. This is plain wrong, and only occurred because the gesturetest code had a path for doing this (gesturetest code was basically copied and pasted into Unity). Thus far, 1/1 gesture projects have used gesturetest and subsequently been written improperly :).

That said, I'm apparently in the minority and this isn't a huge deal. I'll merge this change in when I have a chance.

review: Approve
Revision history for this message
Mohamed Amine Ilidrissi (ilidrissi.amine) wrote :

> I still disagree as I think this may lead to sloppy coding. For example,
> adding 0 as a window parameter to gesturetest to listen on all windows has
> already led to an improper implementation of gestures in Unity. Unity
> currently listens for window specific gestures on all windows, including root,
> and uses the focus point to choose the correct window for manipulation. This
> is plain wrong, and only occurred because the gesturetest code had a path for
> doing this (gesturetest code was basically copied and pasted into Unity). Thus
> far, 1/1 gesture projects have used gesturetest and subsequently been written
> improperly :).
>
> That said, I'm apparently in the minority and this isn't a huge deal. I'll
> merge this change in when I have a chance.

Your opinion still counts, though. You shouldn't approve this just because everyone else is okay with it. That said, thanks :)

Revision history for this message
Chase Douglas (chasedouglas) wrote :

Gesturetest is dead, so I'm rejecting this proposal.

Unmerged revisions

12. By Mohamed Amine Ilidrissi

Fixed the code.

11. By Rafi

Default args to 0 0 0xffffffffffffffff if no args are specified on the command
line. This should show all gestures that aren't caught by an application
(and fall through to the root window).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/main.c'
--- src/main.c 2010-08-12 09:43:29 +0000
+++ src/main.c 2010-09-25 18:22:39 +0000
@@ -40,42 +40,54 @@
40 uint32_t **mask) {40 uint32_t **mask) {
41 unsigned long long int tmp;41 unsigned long long int tmp;
42 char *end;42 char *end;
43 int i;43 int i;
4444
45 if (argc != 4) {45 switch(argc) {
46 usage(argv[0]);46 case 1:
47 return -1;47 *window = (xcb_window_t)0;
48 }48 *device_id = (uint16_t)0;
4949 *mask_len = 2;
50 tmp = strtoul(argv[1], &end, 0);50 *mask = malloc(sizeof(uint32_t) * *mask_len);
51 if (*end != '\0' || tmp > UINT_MAX) {51 (*mask)[0] = 0xffffffff;
52 usage(argv[0]);52 (*mask)[1] = 0xffffffff;
53 return -1;53 break;
54 }54 case 4:
55 *window = (xcb_window_t)tmp;55 tmp = strtoul(argv[1], &end, 0);
5656 if (*end != '\0' || tmp > UINT_MAX) {
57 tmp = strtoul(argv[2], &end, 0);57 usage(argv[0]);
58 if (*end != '\0' || tmp > USHRT_MAX) {58 return -1;
59 usage(argv[0]);59 }
60 return -1;60 *window = (xcb_window_t)tmp;
61 }61
62 *device_id = (uint16_t)tmp;62 tmp = strtoul(argv[2], &end, 0);
6363 if (*end != '\0' || tmp > USHRT_MAX) {
64 tmp = strtoull(argv[3], &end, 0);64 usage(argv[0]);
65 if (*end != '\0') {65 return -1;
66 usage(argv[0]);66 }
67 return -1;67 *device_id = (uint16_t)tmp;
68 }68
69 *mask_len = (tmp > UINT_MAX) ? 2 : 1;69 tmp = strtoull(argv[3], &end, 0);
70 70 if (*end != '\0') {
71 *mask = malloc(sizeof(uint32_t) * *mask_len);71 usage(argv[0]);
72 if (!*mask) {72 return -1;
73 perror("Error: Failed to allocate event mask");73 }
74 return -1;74 *mask_len = (tmp > UINT_MAX) ? 2 : 1;
75 }75
7676 *mask = malloc(sizeof(uint32_t) * *mask_len);
77 for (i = 0; i < *mask_len; i++)77 if (!*mask) {
78 (*mask)[i] = tmp >> (32 * i);78 perror("Error: Failed to allocate event mask");
79 return -1;
80 }
81
82 for (i = 0; i < *mask_len; i++)
83 (*mask)[i] = tmp >> (32 * i);
84
85 break;
86 default:
87 usage(argv[0]);
88 return -1;
89 }
90
7991
80 return 0;92 return 0;
81}93}

Subscribers

People subscribed via source and target branches