edges = evdev_device_mm_to_units(device, &mm);
tp->palm.right_edge = edges.x;
- if (!tp->buttons.has_topbuttons) {
+ if (!tp->buttons.has_topbuttons && height > 55) {
/* top edge is 5% of the height */
mm.y = height * 0.05;
edges = evdev_device_mm_to_units(device, &mm);
}
END_TEST
-static int
+static bool
touchpad_has_palm_detect_size(struct litest_device *dev)
{
double width, height;
return rc == 0 && width >= 70;
}
+static bool
+touchpad_has_top_palm_detect_size(struct litest_device *dev)
+{
+ double width, height;
+ int rc;
+
+ if (!touchpad_has_palm_detect_size(dev))
+ return false;
+
+ rc = libinput_device_get_size(dev->libinput_device, &width, &height);
+
+ return rc == 0 && height > 55;
+}
+
START_TEST(touchpad_palm_detect_at_edge)
{
struct litest_device *dev = litest_current_device();
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (!touchpad_has_palm_detect_size(dev))
+ if (!touchpad_has_top_palm_detect_size(dev))
return;
litest_disable_tap(dev->libinput_device);
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (!touchpad_has_palm_detect_size(dev))
+ if (!touchpad_has_top_palm_detect_size(dev))
return;
litest_disable_tap(dev->libinput_device);
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (!touchpad_has_palm_detect_size(dev))
+ if (!touchpad_has_top_palm_detect_size(dev))
return;
litest_disable_tap(dev->libinput_device);
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (!touchpad_has_palm_detect_size(dev))
+ if (!touchpad_has_top_palm_detect_size(dev))
return;
litest_disable_tap(dev->libinput_device);
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (!touchpad_has_palm_detect_size(dev))
+ if (!touchpad_has_top_palm_detect_size(dev))
return;
litest_enable_tap(dev->libinput_device);