summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2011-03-25 19:57:52 +0100
committerHenrik Rydberg <rydberg@euromail.se>2011-03-28 22:02:11 +0200
commit841384969a0b080bdc860c1bda43b68f9c904daf (patch)
tree34c53df62f88a2dee1c2beda52d02272324987de
parent9a99564617a6c308bc2fc352726581dae0515195 (diff)
Never active gestures below activation threshold
Currently, all gestures activate after a certain time, such that the smallest change result in gesture events. This was designed to minimize disruption in pointer movement. Since grail no longer handles pointers, the logic can be simplified to only activate when the threshold is reached. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
-rw-r--r--src/grail-gestures.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/grail-gestures.c b/src/grail-gestures.c
index 2c0fc40..fd8b26b 100644
--- a/src/grail-gestures.c
+++ b/src/grail-gestures.c
@@ -133,15 +133,14 @@ static void move_update(struct move_model *m, int i, float x, grail_time_t t)
133 m->tickle &= ~(1 << i); 133 m->tickle &= ~(1 << i);
134 if (m->active & (1 << i)) 134 if (m->active & (1 << i))
135 return; 135 return;
136 fm->action_delta = x - fm->original; 136 fm->action_delta = 0;
137 if (t - fm->original_ms > fm->hold_ms && 137 if (fabs(x - fm->original) > fm->bar) {
138 fabs(fm->action_delta) > fm->bar) { 138 if (t - fm->original_ms > fm->hold_ms) {
139 m->active |= (1 << i); 139 m->active |= (1 << i);
140 fm->action_delta = x - fm->original;
141 }
140 } else if (t - fm->original_ms > fm->bar_ms) { 142 } else if (t - fm->original_ms > fm->bar_ms) {
141 m->active |= (1 << i);
142 m->timeout |= (1 << i); 143 m->timeout |= (1 << i);
143 } else {
144 fm->action_delta = 0;
145 } 144 }
146} 145}
147 146