Lines Matching defs:thumb
56 if (tp->thumb.state == state && tp->thumb.index == index)
60 "thumb: touch %d, %s → %s\n",
62 thumb_state_to_str(tp->thumb.state),
65 tp->thumb.state = state;
66 tp->thumb.index = index;
72 tp->thumb.state = THUMB_STATE_FINGER;
73 tp->thumb.index = UINT_MAX;
74 tp->thumb.pinch_eligible = true;
80 tp->thumb.state = THUMB_STATE_FINGER;
81 tp->thumb.index = UINT_MAX;
88 return (t->point.y > tp->thumb.lower_thumb_line &&
99 if (tp->thumb.use_pressure &&
100 t->pressure > tp->thumb.pressure_threshold &&
105 if (tp->thumb.use_size &&
106 (t->major > tp->thumb.size_threshold) &&
107 (t->minor < (tp->thumb.size_threshold * 0.6))) {
117 if (t->point.y < tp->thumb.upper_thumb_line ||
122 (tp->thumb.use_size || tp->thumb.use_pressure) &&
135 return (tp->thumb.detect_thumbs &&
136 tp->thumb.index == t->index &&
137 (tp->thumb.state == THUMB_STATE_JAILED ||
138 tp->thumb.state == THUMB_STATE_PINCH ||
139 tp->thumb.state == THUMB_STATE_SUPPRESSED ||
140 tp->thumb.state == THUMB_STATE_REVIVED_JAILED ||
141 tp->thumb.state == THUMB_STATE_DEAD));
148 return (tp->thumb.detect_thumbs &&
149 tp->thumb.index == t->index &&
150 (tp->thumb.state == THUMB_STATE_PINCH ||
151 tp->thumb.state == THUMB_STATE_SUPPRESSED ||
152 tp->thumb.state == THUMB_STATE_DEAD));
159 return (tp->thumb.detect_thumbs &&
160 tp->thumb.index == t->index &&
161 (tp->thumb.state == THUMB_STATE_JAILED ||
162 tp->thumb.state == THUMB_STATE_SUPPRESSED ||
163 tp->thumb.state == THUMB_STATE_REVIVED_JAILED ||
164 tp->thumb.state == THUMB_STATE_DEAD));
170 if(tp->thumb.state == THUMB_STATE_FINGER ||
171 tp->thumb.state == THUMB_STATE_JAILED ||
172 tp->thumb.state == THUMB_STATE_PINCH ||
173 tp->thumb.index != t->index) {
184 if(tp->thumb.state == THUMB_STATE_FINGER ||
185 tp->thumb.state == THUMB_STATE_JAILED ||
186 tp->thumb.index != t->index)
188 else if (tp->thumb.state != THUMB_STATE_PINCH)
195 if((tp->thumb.state != THUMB_STATE_SUPPRESSED &&
196 tp->thumb.state != THUMB_STATE_PINCH) ||
197 (tp->thumb.index != t->index))
211 if (!tp->thumb.detect_thumbs)
218 tp->thumb.pinch_eligible &&
220 tp->thumb.pinch_eligible = false;
221 if(tp->thumb.state == THUMB_STATE_PINCH) {
222 struct tp_touch *thumb;
223 tp_for_each_touch(tp, thumb) {
224 if (thumb->index != tp->thumb.index)
227 tp_thumb_set_state(tp, thumb, THUMB_STATE_SUPPRESSED);
233 /* Handle the thumb lifting off the touchpad */
234 if (t->state == TOUCH_END && t->index == tp->thumb.index) {
239 /* If this touch is not the only one, thumb updates happen by context
258 /* If a touch breaks the speed threshold, or leaves the thumb area
261 if (tp->thumb.state == THUMB_STATE_JAILED &&
264 if (tp->thumb.state == THUMB_STATE_REVIVED_JAILED &&
323 /* Speed-based thumb detection: if an existing finger is moving, and
324 * a new touch arrives, mark it as a thumb if it doesn't qualify as a
325 * 2-finger scroll. Also account for a thumb dropping onto the touchpad
329 tp->thumb.state == THUMB_STATE_FINGER &&
335 "touch %d is speed-based thumb\n",
341 /* Contextual thumb detection: When a new touch arrives, check the
357 * there is an actual resting thumb, it will be detected later based on
363 first->point.y < tp->thumb.lower_thumb_line) {
370 * Proceed with pre-1.14.901 thumb detection.
374 if (tp->thumb.pinch_eligible)
394 tp->thumb.detect_thumbs = false;
399 /* if the touchpad is less than 50mm high, skip thumb detection.
400 * it's too small to meaningfully interact with a thumb on the
406 tp->thumb.detect_thumbs = true;
407 tp->thumb.use_pressure = false;
408 tp->thumb.pressure_threshold = INT_MAX;
414 tp->thumb.upper_thumb_line = edges.y;
418 tp->thumb.lower_thumb_line = edges.y;
427 tp->thumb.use_pressure = true;
428 tp->thumb.pressure_threshold = threshold;
436 tp->thumb.use_size = true;
437 tp->thumb.size_threshold = threshold;
446 "thumb: enabled thumb detection (area%s%s)\n",
447 tp->thumb.use_pressure ? ", pressure" : "",
448 tp->thumb.use_size ? ", size" : "");
454 struct tp_touch *thumb;
456 if (tp->thumb.index == UINT_MAX)
459 tp_for_each_touch(tp, thumb) {
460 if (thumb->index == tp->thumb.index)
461 return thumb;