mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-07 11:58:04 +02:00
touchpad: enable palm detection on tablets' touchpads
https://bugs.freedesktop.org/show_bug.cgi?id=104986 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
b1ddd1effe
commit
a437d9374b
4 changed files with 25 additions and 6 deletions
|
|
@ -2788,6 +2788,12 @@ tp_is_tpkb_combo_below(struct evdev_device *device)
|
||||||
layout == TPKBCOMBO_LAYOUT_BELOW;
|
layout == TPKBCOMBO_LAYOUT_BELOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool
|
||||||
|
tp_is_tablet(struct evdev_device *device)
|
||||||
|
{
|
||||||
|
return device->tags & EVDEV_TAG_TABLET_TOUCHPAD;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
tp_init_dwt(struct tp_dispatch *tp,
|
tp_init_dwt(struct tp_dispatch *tp,
|
||||||
struct evdev_device *device)
|
struct evdev_device *device)
|
||||||
|
|
@ -2885,9 +2891,6 @@ tp_init_palmdetect_size(struct tp_dispatch *tp,
|
||||||
const char *prop;
|
const char *prop;
|
||||||
int threshold;
|
int threshold;
|
||||||
|
|
||||||
if (!tp->touch_size.use_touch_size)
|
|
||||||
return;
|
|
||||||
|
|
||||||
prop = udev_device_get_property_value(device->udev_device,
|
prop = udev_device_get_property_value(device->udev_device,
|
||||||
"LIBINPUT_ATTR_PALM_SIZE_THRESHOLD");
|
"LIBINPUT_ATTR_PALM_SIZE_THRESHOLD");
|
||||||
if (!prop)
|
if (!prop)
|
||||||
|
|
@ -2934,17 +2937,20 @@ tp_init_palmdetect(struct tp_dispatch *tp,
|
||||||
tp_init_palmdetect_arbitration(tp, device);
|
tp_init_palmdetect_arbitration(tp, device);
|
||||||
|
|
||||||
if (device->tags & EVDEV_TAG_EXTERNAL_TOUCHPAD &&
|
if (device->tags & EVDEV_TAG_EXTERNAL_TOUCHPAD &&
|
||||||
!tp_is_tpkb_combo_below(device))
|
!tp_is_tpkb_combo_below(device) &&
|
||||||
|
!tp_is_tablet(device))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
tp->palm.monitor_trackpoint = true;
|
if (!tp_is_tablet(device))
|
||||||
|
tp->palm.monitor_trackpoint = true;
|
||||||
|
|
||||||
if (libevdev_has_event_code(device->evdev,
|
if (libevdev_has_event_code(device->evdev,
|
||||||
EV_ABS,
|
EV_ABS,
|
||||||
ABS_MT_TOOL_TYPE))
|
ABS_MT_TOOL_TYPE))
|
||||||
tp->palm.use_mt_tool = true;
|
tp->palm.use_mt_tool = true;
|
||||||
|
|
||||||
tp_init_palmdetect_edge(tp, device);
|
if (!tp_is_tablet(device))
|
||||||
|
tp_init_palmdetect_edge(tp, device);
|
||||||
tp_init_palmdetect_pressure(tp, device);
|
tp_init_palmdetect_pressure(tp, device);
|
||||||
tp_init_palmdetect_size(tp, device);
|
tp_init_palmdetect_size(tp, device);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -441,6 +441,12 @@ evdev_tag_keyboard(struct evdev_device *device,
|
||||||
device->tags |= EVDEV_TAG_KEYBOARD;
|
device->tags |= EVDEV_TAG_KEYBOARD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
evdev_tag_tablet_touchpad(struct evdev_device *device)
|
||||||
|
{
|
||||||
|
device->tags |= EVDEV_TAG_TABLET_TOUCHPAD;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
evdev_calibration_has_matrix(struct libinput_device *libinput_device)
|
evdev_calibration_has_matrix(struct libinput_device *libinput_device)
|
||||||
{
|
{
|
||||||
|
|
@ -1638,6 +1644,8 @@ evdev_configure_device(struct evdev_device *device)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (udev_tags & EVDEV_UDEV_TAG_TOUCHPAD) {
|
if (udev_tags & EVDEV_UDEV_TAG_TOUCHPAD) {
|
||||||
|
if (udev_tags & EVDEV_UDEV_TAG_TABLET)
|
||||||
|
evdev_tag_tablet_touchpad(device);
|
||||||
dispatch = evdev_mt_touchpad_create(device);
|
dispatch = evdev_mt_touchpad_create(device);
|
||||||
evdev_log_info(device, "device is a touchpad\n");
|
evdev_log_info(device, "device is a touchpad\n");
|
||||||
return dispatch;
|
return dispatch;
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ enum evdev_device_tags {
|
||||||
EVDEV_TAG_INTERNAL_KEYBOARD = (1 << 6),
|
EVDEV_TAG_INTERNAL_KEYBOARD = (1 << 6),
|
||||||
EVDEV_TAG_EXTERNAL_KEYBOARD = (1 << 7),
|
EVDEV_TAG_EXTERNAL_KEYBOARD = (1 << 7),
|
||||||
EVDEV_TAG_TABLET_MODE_SWITCH = (1 << 8),
|
EVDEV_TAG_TABLET_MODE_SWITCH = (1 << 8),
|
||||||
|
EVDEV_TAG_TABLET_TOUCHPAD = (1 << 9),
|
||||||
};
|
};
|
||||||
|
|
||||||
enum evdev_middlebutton_state {
|
enum evdev_middlebutton_state {
|
||||||
|
|
|
||||||
|
|
@ -282,6 +282,10 @@ libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnSystem76*pvrkudp1*
|
||||||
libinput:touchpad:input:b0003v056Ap*
|
libinput:touchpad:input:b0003v056Ap*
|
||||||
LIBINPUT_MODEL_WACOM_TOUCHPAD=1
|
LIBINPUT_MODEL_WACOM_TOUCHPAD=1
|
||||||
|
|
||||||
|
# Wacom Intuos Pro PTH-660
|
||||||
|
libinput:touchpad:input:b0003v056Ap0357*
|
||||||
|
LIBINPUT_ATTR_PALM_SIZE_THRESHOLD=5
|
||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
# Anything that has trackball in the name
|
# Anything that has trackball in the name
|
||||||
##########################################
|
##########################################
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue