}
static inline int
+evdev_read_attr_res_prop(struct evdev_device *device,
+ size_t *xres,
+ size_t *yres)
+{
+ struct udev_device *udev;
+ const char *res_prop;
+
+ udev = device->udev_device;
+ res_prop = udev_device_get_property_value(udev,
+ "LIBINPUT_ATTR_RESOLUTION_HINT");
+ if (!res_prop)
+ return false;
+
+ return parse_dimension_property(res_prop, xres, yres);
+}
+
+static inline int
evdev_read_attr_size_prop(struct evdev_device *device,
size_t *size_x,
size_t *size_y)
struct libevdev *evdev = device->evdev;
const struct input_absinfo *absx, *absy;
size_t widthmm = 0, heightmm = 0;
- int xres = EVDEV_FAKE_RESOLUTION,
- yres = EVDEV_FAKE_RESOLUTION;
+ size_t xres = EVDEV_FAKE_RESOLUTION,
+ yres = EVDEV_FAKE_RESOLUTION;
if (!(xcode == ABS_X && ycode == ABS_Y) &&
!(xcode == ABS_MT_POSITION_X && ycode == ABS_MT_POSITION_Y)) {
* property is only for general size hints where we can make
* educated guesses but don't know better.
*/
- if (evdev_read_attr_size_prop(device, &widthmm, &heightmm)) {
+ if (!evdev_read_attr_res_prop(device, &xres, &yres) &&
+ evdev_read_attr_size_prop(device, &widthmm, &heightmm)) {
xres = (absx->maximum - absx->minimum)/widthmm;
yres = (absy->maximum - absy->minimum)/heightmm;
}
LIBINPUT_ATTR_SIZE_HINT=104x75
##########################################
+# Elantech
+##########################################
+libinput:name:*ETPS/2 Elantech Touchpad*:dmi:*
+ LIBINPUT_ATTR_RESOLUTION_HINT=31x31
+
+##########################################
# Google
##########################################