diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2011-03-04 01:00:41 +0100 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2011-03-14 12:55:20 +0100 |
| commit | b0ce015a8494bdc48e4d38ddf22b7e5e4c02814a (patch) | |
| tree | 30c1be9c76caf58d51d6829bb8b123d67e03a426 | |
| parent | 1985003a9541c20f9a7139bab499d2259e70ed4f (diff) | |
Make grabbing client exclusive
When a possible gesture is started for a global client (sysflag set),
it is desirable that gestures to other clients are disregarded until
all contacts have left the surface. In principle this could be refined
further, such that if gesture are not detected, they are passed on to
other clients, but that also affects how touches are passed onto lower
layers like XI2.1, so simply making sure a global system client gets
all events potentially leading to gestures is good enough for now.
Also note that in the current combination of synaptics/evdev X servers
and grail, there can be no overlapping potential gestures between two
global clients, or the resulting event recipient is not correct.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| -rw-r--r-- | src/grail-inserter.c | 9 | ||||
| -rw-r--r-- | src/grail-inserter.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/grail-inserter.c b/src/grail-inserter.c index 6f9a034..ff4f0b6 100644 --- a/src/grail-inserter.c +++ b/src/grail-inserter.c | |||
| @@ -69,6 +69,13 @@ static void setup_new_gestures(struct grail *ge, | |||
| 69 | for (j = 0; j < nclient; j++) { | 69 | for (j = 0; j < nclient; j++) { |
| 70 | if (!grail_mask_get(info[j].mask, s->type)) | 70 | if (!grail_mask_get(info[j].mask, s->type)) |
| 71 | continue; | 71 | continue; |
| 72 | if (gin->grab_active && | ||
| 73 | info[j].id.client != gin->grab_client) | ||
| 74 | continue; | ||
| 75 | if (grail_mask_get(info[j].mask, GRAIL_TYPE_SYSFLAG1)) { | ||
| 76 | gin->grab_active = 1; | ||
| 77 | gin->grab_client = info[j].id.client; | ||
| 78 | } | ||
| 72 | s->client_id[s->nclient++] = info[j].id; | 79 | s->client_id[s->nclient++] = info[j].id; |
| 73 | } | 80 | } |
| 74 | } | 81 | } |
| @@ -105,6 +112,8 @@ void gin_frame_begin(struct grail *ge, const struct utouch_frame *frame) | |||
| 105 | struct gesture_inserter *gin = ge->gin; | 112 | struct gesture_inserter *gin = ge->gin; |
| 106 | memset(gin->types, 0, sizeof(gin->types)); | 113 | memset(gin->types, 0, sizeof(gin->types)); |
| 107 | gin->time = frame->time; | 114 | gin->time = frame->time; |
| 115 | if (frame->num_active && !frame->prev->num_active) | ||
| 116 | gin->grab_active = 0; | ||
| 108 | } | 117 | } |
| 109 | 118 | ||
| 110 | void gin_frame_end(struct grail *ge, const struct utouch_frame *frame) | 119 | void gin_frame_end(struct grail *ge, const struct utouch_frame *frame) |
diff --git a/src/grail-inserter.h b/src/grail-inserter.h index 3b8cd77..fb944dd 100644 --- a/src/grail-inserter.h +++ b/src/grail-inserter.h | |||
| @@ -53,6 +53,8 @@ struct gesture_inserter { | |||
| 53 | grail_mask_t used[DIM_INSTANCE_BYTES]; | 53 | grail_mask_t used[DIM_INSTANCE_BYTES]; |
| 54 | grail_time_t time; | 54 | grail_time_t time; |
| 55 | int gestureid; | 55 | int gestureid; |
| 56 | int grab_active; | ||
| 57 | int grab_client; | ||
| 56 | float scale_x, scale_y, scale_r; | 58 | float scale_x, scale_y, scale_r; |
| 57 | float trans_x, trans_y; | 59 | float trans_x, trans_y; |
| 58 | }; | 60 | }; |
