diff options
Diffstat (limited to 'src/grail-inserter.c')
| -rw-r--r-- | src/grail-inserter.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/grail-inserter.c b/src/grail-inserter.c index ff4f0b6..1ee8e5a 100644 --- a/src/grail-inserter.c +++ b/src/grail-inserter.c | |||
| @@ -119,7 +119,7 @@ void gin_frame_begin(struct grail *ge, const struct utouch_frame *frame) | |||
| 119 | 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) |
| 120 | { | 120 | { |
| 121 | struct gesture_inserter *gin = ge->gin; | 121 | struct gesture_inserter *gin = ge->gin; |
| 122 | int i, hold = 0, discard = 0; | 122 | int i, hold[2] = { 0, 0 }, discard[2] = { 0, 0 }; |
| 123 | 123 | ||
| 124 | setup_new_gestures(ge, frame); | 124 | setup_new_gestures(ge, frame); |
| 125 | 125 | ||
| @@ -127,17 +127,17 @@ void gin_frame_end(struct grail *ge, const struct utouch_frame *frame) | |||
| 127 | struct slot_state *s = &gin->state[i]; | 127 | struct slot_state *s = &gin->state[i]; |
| 128 | if (!s->nclient) | 128 | if (!s->nclient) |
| 129 | continue; | 129 | continue; |
| 130 | if (s->priority > hold) | 130 | if (s->priority > hold[s->slice]) |
| 131 | hold = s->priority; | 131 | hold[s->slice] = s->priority; |
| 132 | if (s->status != GRAIL_STATUS_UPDATE) | 132 | if (s->status != GRAIL_STATUS_UPDATE) |
| 133 | continue; | 133 | continue; |
| 134 | if (s->priority > discard) | 134 | if (s->priority > discard[s->slice]) |
| 135 | discard = s->priority; | 135 | discard[s->slice] = s->priority; |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | grail_mask_foreach(i, gin->used, sizeof(gin->used)) { | 138 | grail_mask_foreach(i, gin->used, sizeof(gin->used)) { |
| 139 | struct slot_state *s = &gin->state[i]; | 139 | struct slot_state *s = &gin->state[i]; |
| 140 | if (!s->nclient || s->priority < discard) | 140 | if (!s->nclient || s->priority < discard[s->slice]) |
| 141 | gin_gid_discard(ge, s->id); | 141 | gin_gid_discard(ge, s->id); |
| 142 | } | 142 | } |
| 143 | 143 | ||
| @@ -145,7 +145,7 @@ void gin_frame_end(struct grail *ge, const struct utouch_frame *frame) | |||
| 145 | struct slot_state *s = &gin->state[i]; | 145 | struct slot_state *s = &gin->state[i]; |
| 146 | struct gesture_event ev; | 146 | struct gesture_event ev; |
| 147 | grail_mask_set(gin->types, s->type); | 147 | grail_mask_set(gin->types, s->type); |
| 148 | if (s->priority < hold) | 148 | if (s->priority < hold[s->slice]) |
| 149 | continue; | 149 | continue; |
| 150 | while (!gebuf_empty(&s->buf)) { | 150 | while (!gebuf_empty(&s->buf)) { |
| 151 | gebuf_get(&s->buf, &ev); | 151 | gebuf_get(&s->buf, &ev); |
| @@ -171,7 +171,13 @@ int gin_gid_begin(struct grail *ge, int type, int priority, | |||
| 171 | return -1; | 171 | return -1; |
| 172 | s = &gin->state[i]; | 172 | s = &gin->state[i]; |
| 173 | s->type = type; | 173 | s->type = type; |
| 174 | s->priority = priority; | 174 | if (priority < 0) { |
| 175 | s->priority = -priority; | ||
| 176 | s->slice = 1; | ||
| 177 | } else { | ||
| 178 | s->priority = priority; | ||
| 179 | s->slice = 0; | ||
| 180 | } | ||
| 175 | s->id = gin->gestureid++ & MAX_GESTURE_ID; | 181 | s->id = gin->gestureid++ & MAX_GESTURE_ID; |
| 176 | s->status = GRAIL_STATUS_BEGIN; | 182 | s->status = GRAIL_STATUS_BEGIN; |
| 177 | s->nclient = 0; | 183 | s->nclient = 0; |
