diff options
Diffstat (limited to 'src/gestures-pinch.c')
| -rw-r--r-- | src/gestures-pinch.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gestures-pinch.c b/src/gestures-pinch.c index 6c5392d..0721e02 100644 --- a/src/gestures-pinch.c +++ b/src/gestures-pinch.c | |||
| @@ -26,6 +26,15 @@ | |||
| 26 | #include <math.h> | 26 | #include <math.h> |
| 27 | #include <stdio.h> | 27 | #include <stdio.h> |
| 28 | 28 | ||
| 29 | static const int getype[DIM_TOUCH + 1] = { | ||
| 30 | 0, | ||
| 31 | 0, | ||
| 32 | GRAIL_TYPE_PINCH, | ||
| 33 | GRAIL_TYPE_SCALE, | ||
| 34 | GRAIL_TYPE_PICK, | ||
| 35 | GRAIL_TYPE_GRAB, | ||
| 36 | }; | ||
| 37 | |||
| 29 | int gru_pinch(struct grail *ge, | 38 | int gru_pinch(struct grail *ge, |
| 30 | const struct touch_frame *frame) | 39 | const struct touch_frame *frame) |
| 31 | { | 40 | { |
| @@ -40,11 +49,12 @@ int gru_pinch(struct grail *ge, | |||
| 40 | } | 49 | } |
| 41 | return 0; | 50 | return 0; |
| 42 | } | 51 | } |
| 52 | if (!move->a.tickle) | ||
| 53 | return 0; | ||
| 43 | if (!move->r.tickle) | 54 | if (!move->r.tickle) |
| 44 | return 0; | 55 | return 0; |
| 45 | if (!state->active) { | 56 | if (!state->active) { |
| 46 | int type = move->ntouch == 2 ? GRAIL_TYPE_PINCH : | 57 | int type = getype[move->ntouch]; |
| 47 | move->ntouch == 3 ? GRAIL_TYPE_SCALE : 0; | ||
| 48 | if (!type) | 58 | if (!type) |
| 49 | return 0; | 59 | return 0; |
| 50 | state->gid = gin_gid_begin(ge, type, PRIO_GESTURE, frame); | 60 | state->gid = gin_gid_begin(ge, type, PRIO_GESTURE, frame); |
