case SCROLL_EVENT_TIMEOUT:
case SCROLL_EVENT_POSTED:
evdev_log_bug_libinput(tp->device,
- "unexpected scroll event %d in none state\n",
+ "edge-scroll: touch %d: unexpected scroll event %d in none state\n",
+ t->index,
event);
break;
}
switch (event) {
case SCROLL_EVENT_TOUCH:
evdev_log_bug_libinput(tp->device,
- "unexpected scroll event %d in edge new state\n",
+ "edge-scroll: touch %d: unexpected scroll event %d in edge new state\n",
+ t->index,
event);
break;
case SCROLL_EVENT_MOTION:
case SCROLL_EVENT_TOUCH:
case SCROLL_EVENT_TIMEOUT:
evdev_log_bug_libinput(tp->device,
- "unexpected scroll event %d in edge state\n",
+ "edge-scroll: touch %d: unexpected scroll event %d in edge state\n",
+ t->index,
event);
break;
case SCROLL_EVENT_MOTION:
}
evdev_log_debug(tp->device,
- "edge state: %s → %s → %s\n",
+ "edge-scroll: touch %d state %s → %s → %s\n",
+ t->index,
edge_state_to_str(current),
edge_event_to_str(event),
edge_state_to_str(t->scroll.edge_state));
}
static inline void
-log_tap_bug(struct tp_dispatch *tp, enum tap_event event)
+log_tap_bug(struct tp_dispatch *tp, struct tp_touch *t, enum tap_event event)
{
evdev_log_bug_libinput(tp->device,
- "invalid tap event %s in state %s\n",
+ "%d: invalid tap event %s in state %s\n",
+ t->index,
tap_event_to_str(event),
tap_state_to_str(tp->tap.state));
case TAP_EVENT_RELEASE:
break;
case TAP_EVENT_MOTION:
- log_tap_bug(tp, event);
+ log_tap_bug(tp, t, event);
break;
case TAP_EVENT_TIMEOUT:
break;
tp->tap.state = TAP_STATE_DEAD;
break;
case TAP_EVENT_THUMB:
- log_tap_bug(tp, event);
+ log_tap_bug(tp, t, event);
break;
case TAP_EVENT_PALM:
tp->tap.state = TAP_STATE_IDLE;
switch (event) {
case TAP_EVENT_MOTION:
case TAP_EVENT_RELEASE:
- log_tap_bug(tp, event);
+ log_tap_bug(tp, t, event);
break;
case TAP_EVENT_TOUCH:
tp->tap.state = TAP_STATE_DRAGGING_OR_DOUBLETAP;
break;
case TAP_EVENT_THUMB:
case TAP_EVENT_PALM:
- log_tap_bug(tp, event);
+ log_tap_bug(tp, t, event);
break;
case TAP_EVENT_PALM_UP:
break;
{
switch (event) {
case TAP_EVENT_RELEASE:
- log_tap_bug(tp, event);
+ log_tap_bug(tp, t, event);
break;
case TAP_EVENT_TOUCH:
tp->tap.state = TAP_STATE_MULTITAP_DOWN;
tp_tap_set_timer(tp, time);
break;
case TAP_EVENT_MOTION:
- log_tap_bug(tp, event);
+ log_tap_bug(tp, t, event);
break;
case TAP_EVENT_TIMEOUT:
tp->tap.state = TAP_STATE_IDLE;
tp_tap_clear_timer(tp);
evdev_log_debug(tp->device,
- "tap state: %s → %s → %s\n",
+ "tap: touch %d state %s → %s → %s\n",
+ t ? (int)t->index : -1,
tap_state_to_str(current),
tap_event_to_str(event),
tap_state_to_str(tp->tap.state));
if (!tp_palm_in_edge(tp, t))
return false;
- evdev_log_debug(tp->device, "palm: palm-tap detected\n");
+ evdev_log_debug(tp->device,
+ "palm: touch %d: palm-tap detected\n",
+ t->index);
return true;
}
t->palm.time > tp->dwt.keyboard_last_press_time) {
t->palm.state = PALM_NONE;
evdev_log_debug(tp->device,
- "palm: touch released, timeout after typing\n");
+ "palm: touch %d released, timeout after typing\n",
+ t->index);
}
}
t->palm.time > tp->palm.trackpoint_last_event_time) {
t->palm.state = PALM_NONE;
evdev_log_debug(tp->device,
- "palm: touch released, timeout after trackpoint\n");
+ "palm: touch %d released, timeout after trackpoint\n", t->index);
}
}
t->minor > tp->palm.size_threshold) {
if (t->palm.state != PALM_TOUCH_SIZE)
evdev_log_debug(tp->device,
- "palm: touch size exceeded\n");
+ "palm: touch %d size exceeded\n",
+ t->index);
t->palm.state = PALM_TOUCH_SIZE;
return true;
}
if (tp_palm_detect_multifinger(tp, t, time)) {
t->palm.state = PALM_NONE;
evdev_log_debug(tp->device,
- "palm: touch released, multiple fingers\n");
+ "palm: touch %d released, multiple fingers\n",
+ t->index);
/* If labelled a touch as palm, we unlabel as palm when
we move out of the palm edge zone within the timeout, provided
} else if (tp_palm_detect_move_out_of_edge(tp, t, time)) {
t->palm.state = PALM_NONE;
evdev_log_debug(tp->device,
- "palm: touch released, out of edge zone\n");
+ "palm: touch %d released, out of edge zone\n",
+ t->index);
}
return false;
} else if (tp_palm_detect_multifinger(tp, t, time)) {
break;
}
evdev_log_debug(tp->device,
- "palm: palm detected (%s)\n",
+ "palm: touch %d, palm detected (%s)\n",
+ t->index,
palm_state);
}
out:
if (t->thumb.state != state)
evdev_log_debug(tp->device,
- "thumb state: %s → %s\n",
+ "thumb state: touch %d, %s → %s\n",
+ t->index,
thumb_state_to_str(state),
thumb_state_to_str(t->thumb.state));
}
if (t->state == TOUCH_HOVERING) {
if (t->pressure >= tp->pressure.high) {
evdev_log_debug(tp->device,
- "pressure: begin touch\n");
+ "pressure: begin touch %d\n",
+ t->index);
/* avoid jumps when landing a finger */
tp_motion_history_reset(t);
tp_begin_touch(tp, t, time);
} else {
if (t->pressure < tp->pressure.low) {
evdev_log_debug(tp->device,
- "pressure: end touch\n");
+ "pressure: end touch %d\n",
+ t->index);
tp_end_touch(tp, t, time);
}
}
if ((t->major > high && t->minor > low) ||
(t->major > low && t->minor > high)) {
evdev_log_debug(tp->device,
- "touch-size: begin touch\n");
+ "touch-size: begin touch %d\n",
+ t->index);
/* avoid jumps when landing a finger */
tp_motion_history_reset(t);
tp_begin_touch(tp, t, time);
} else {
if (t->major < low || t->minor < low) {
evdev_log_debug(tp->device,
- "touch-size: end touch\n");
+ "touch-size: end touch %d\n",
+ t->index);
tp_end_touch(tp, t, time);
}
}
/* Finger are too far apart or 2fg scrolling is disabled, mark
* second finger as thumb */
evdev_log_debug(tp->device,
- "touch is speed-based thumb\n");
+ "touch %d is speed-based thumb\n",
+ second->index);
second->thumb.state = THUMB_STATE_YES;
}
static void
tp_init_touch(struct tp_dispatch *tp,
- struct tp_touch *t)
+ struct tp_touch *t,
+ unsigned int index)
{
t->tp = tp;
t->has_ended = true;
+ t->index = index;
}
static inline void
tp->touches = zalloc(tp->ntouches * sizeof(struct tp_touch));
for (i = 0; i < tp->ntouches; i++)
- tp_init_touch(tp, &tp->touches[i]);
+ tp_init_touch(tp, &tp->touches[i], i);
tp_sync_slots(tp, device);