diff options
| -rw-r--r-- | src/gestures-tapping.c | 6 | ||||
| -rw-r--r-- | src/grail-gestures.c | 13 | ||||
| -rw-r--r-- | src/grail-gestures.h | 3 |
3 files changed, 13 insertions, 9 deletions
diff --git a/src/gestures-tapping.c b/src/gestures-tapping.c index d78e775..a5357e4 100644 --- a/src/gestures-tapping.c +++ b/src/gestures-tapping.c | |||
| @@ -49,12 +49,6 @@ int gru_tapping(struct grail *ge, | |||
| 49 | gin_gid_discard(ge, state->gid); | 49 | gin_gid_discard(ge, state->gid); |
| 50 | state->active = 0; | 50 | state->active = 0; |
| 51 | } | 51 | } |
| 52 | state->x = move->x.val; | ||
| 53 | state->y = move->y.val; | ||
| 54 | } else if (state->ntouch == 1) { | ||
| 55 | if (fabs(move->x.val - state->x) > move->y.bar || | ||
| 56 | fabs(move->y.val - state->y) > move->y.bar) | ||
| 57 | state->status = TAP_CANCEL; | ||
| 58 | } | 52 | } |
| 59 | if (!state->active) { | 53 | if (!state->active) { |
| 60 | int type = GRAIL_TYPE_TAP1 + state->ntouch - 1; | 54 | int type = GRAIL_TYPE_TAP1 + state->ntouch - 1; |
diff --git a/src/grail-gestures.c b/src/grail-gestures.c index cb7e5a3..0c0efdb 100644 --- a/src/grail-gestures.c +++ b/src/grail-gestures.c | |||
| @@ -144,13 +144,23 @@ void gru_motion(struct grail *ge, | |||
| 144 | struct move_model *state = &gru->move; | 144 | struct move_model *state = &gru->move; |
| 145 | float x, y, r, a; | 145 | float x, y, r, a; |
| 146 | compute_position(&x, &y, frame); | 146 | compute_position(&x, &y, frame); |
| 147 | if (frame->nactive < 2 || frame->ncreate || frame->ndestroy) { | 147 | if (frame->ncreate || frame->ndestroy) { |
| 148 | r = compute_radius(x, y, frame); | 148 | r = compute_radius(x, y, frame); |
| 149 | a = 0; | 149 | a = 0; |
| 150 | move_reset(&state->x, x); | 150 | move_reset(&state->x, x); |
| 151 | move_reset(&state->y, y); | 151 | move_reset(&state->y, y); |
| 152 | move_reset(&state->r, r); | 152 | move_reset(&state->r, r); |
| 153 | move_reset(&state->a, a); | 153 | move_reset(&state->a, a); |
| 154 | state->single = 0; | ||
| 155 | state->multi = 0; | ||
| 156 | } else if (frame->nactive < 2) { | ||
| 157 | r = 0; | ||
| 158 | a = 0; | ||
| 159 | move_update(&state->x, x); | ||
| 160 | move_update(&state->y, y); | ||
| 161 | move_reset(&state->r, r); | ||
| 162 | move_reset(&state->a, a); | ||
| 163 | state->single = 1; | ||
| 154 | state->multi = 0; | 164 | state->multi = 0; |
| 155 | } else { | 165 | } else { |
| 156 | x = move_filter(&state->x, x); | 166 | x = move_filter(&state->x, x); |
| @@ -163,6 +173,7 @@ void gru_motion(struct grail *ge, | |||
| 163 | move_update(&state->y, y); | 173 | move_update(&state->y, y); |
| 164 | move_update(&state->r, r); | 174 | move_update(&state->r, r); |
| 165 | move_update(&state->a, a); | 175 | move_update(&state->a, a); |
| 176 | state->single = 0; | ||
| 166 | state->multi = 1; | 177 | state->multi = 1; |
| 167 | } | 178 | } |
| 168 | state->ntouch = frame->nactive; | 179 | state->ntouch = frame->nactive; |
diff --git a/src/grail-gestures.h b/src/grail-gestures.h index 0447100..6ba6cf7 100644 --- a/src/grail-gestures.h +++ b/src/grail-gestures.h | |||
| @@ -36,7 +36,7 @@ struct filter_model { | |||
| 36 | 36 | ||
| 37 | struct move_model { | 37 | struct move_model { |
| 38 | struct filter_model x, y, r, a; | 38 | struct filter_model x, y, r, a; |
| 39 | int multi, ntouch; | 39 | int single, multi, ntouch; |
| 40 | float dx, dy, dr, da; | 40 | float dx, dy, dr, da; |
| 41 | grail_time_t time; | 41 | grail_time_t time; |
| 42 | }; | 42 | }; |
| @@ -63,7 +63,6 @@ int gru_combo(struct grail *ge, | |||
| 63 | 63 | ||
| 64 | struct tapping_model { | 64 | struct tapping_model { |
| 65 | grail_time_t start; | 65 | grail_time_t start; |
| 66 | float x, y; | ||
| 67 | int status, ntouch; | 66 | int status, ntouch; |
| 68 | int active, gid; | 67 | int active, gid; |
| 69 | }; | 68 | }; |
