mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-04 17:50:15 +01:00
touchpad: make palm detection logging a bit easier
Nested trinary conditions are fun, but... Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
ddcf1f61bf
commit
5a63c82822
1 changed files with 21 additions and 3 deletions
|
|
@ -715,6 +715,8 @@ tp_palm_detect_edge(struct tp_dispatch *tp,
|
|||
static void
|
||||
tp_palm_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time)
|
||||
{
|
||||
const char *palm_state;
|
||||
enum touch_palm_state oldstate = t->palm.state;
|
||||
|
||||
if (tp_palm_detect_dwt_triggered(tp, t, time))
|
||||
goto out;
|
||||
|
|
@ -726,12 +728,28 @@ tp_palm_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time)
|
|||
goto out;
|
||||
|
||||
return;
|
||||
|
||||
out:
|
||||
if (oldstate == t->palm.state)
|
||||
return;
|
||||
|
||||
switch (t->palm.state) {
|
||||
case PALM_EDGE:
|
||||
palm_state = "edge";
|
||||
break;
|
||||
case PALM_TYPING:
|
||||
palm_state = "typing";
|
||||
break;
|
||||
case PALM_TRACKPOINT:
|
||||
palm_state = "trackpoint";
|
||||
break;
|
||||
case PALM_NONE:
|
||||
default:
|
||||
abort();
|
||||
break;
|
||||
}
|
||||
evdev_log_debug(tp->device,
|
||||
"palm: palm detected (%s)\n",
|
||||
t->palm.state == PALM_EDGE ? "edge" :
|
||||
t->palm.state == PALM_TYPING ? "typing" : "trackpoint");
|
||||
palm_state);
|
||||
}
|
||||
|
||||
static inline const char*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue