mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-26 17:48:15 +02:00
touchpad: move edge palm init to separate helper
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
160d60eb85
commit
76fce6cddd
1 changed files with 18 additions and 12 deletions
|
|
@ -2224,23 +2224,14 @@ tp_init_dwt(struct tp_dispatch *tp,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static inline void
|
||||||
tp_init_palmdetect(struct tp_dispatch *tp,
|
tp_init_palmdetect_edge(struct tp_dispatch *tp,
|
||||||
struct evdev_device *device)
|
struct evdev_device *device)
|
||||||
{
|
{
|
||||||
double width, height;
|
double width, height;
|
||||||
struct phys_coords mm = { 0.0, 0.0 };
|
struct phys_coords mm = { 0.0, 0.0 };
|
||||||
struct device_coords edges;
|
struct device_coords edges;
|
||||||
|
|
||||||
tp->palm.right_edge = INT_MAX;
|
|
||||||
tp->palm.left_edge = INT_MIN;
|
|
||||||
|
|
||||||
if (device->tags & EVDEV_TAG_EXTERNAL_TOUCHPAD &&
|
|
||||||
!tp_is_tpkb_combo_below(device))
|
|
||||||
return;
|
|
||||||
|
|
||||||
tp->palm.monitor_trackpoint = true;
|
|
||||||
|
|
||||||
evdev_device_get_size(device, &width, &height);
|
evdev_device_get_size(device, &width, &height);
|
||||||
|
|
||||||
/* Enable palm detection on touchpads >= 70 mm. Anything smaller
|
/* Enable palm detection on touchpads >= 70 mm. Anything smaller
|
||||||
|
|
@ -2256,8 +2247,23 @@ tp_init_palmdetect(struct tp_dispatch *tp,
|
||||||
mm.x = width * 0.95;
|
mm.x = width * 0.95;
|
||||||
edges = evdev_device_mm_to_units(device, &mm);
|
edges = evdev_device_mm_to_units(device, &mm);
|
||||||
tp->palm.right_edge = edges.x;
|
tp->palm.right_edge = edges.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
tp_init_palmdetect(struct tp_dispatch *tp,
|
||||||
|
struct evdev_device *device)
|
||||||
|
{
|
||||||
|
|
||||||
|
tp->palm.right_edge = INT_MAX;
|
||||||
|
tp->palm.left_edge = INT_MIN;
|
||||||
|
|
||||||
|
if (device->tags & EVDEV_TAG_EXTERNAL_TOUCHPAD &&
|
||||||
|
!tp_is_tpkb_combo_below(device))
|
||||||
|
return;
|
||||||
|
|
||||||
tp->palm.monitor_trackpoint = true;
|
tp->palm.monitor_trackpoint = true;
|
||||||
|
|
||||||
|
tp_init_palmdetect_edge(tp, device);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue