[PATCH libinput 4/3] evdev: Fix reported resolution of Lenovo X230 touchpads
Benjamin Tissoires
benjamin.tissoires at gmail.com
Thu Apr 9 10:30:40 PDT 2015
The Lenovo X230 advertise a vertical resolution of 136, which gives a size
of 31 mm. The actual size of the touchpad is 40mm, so override the
resolution to 100.
/!\ This is a temporary fix. The proper fix should go in hwdb. /!\
Signed-off-by: Benjamin Tissoires <benjamin.tissoires at gmail.com>
---
src/evdev.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/src/evdev.c b/src/evdev.c
index 88d9169..9073eb6 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1463,6 +1463,17 @@ evdev_fix_android_mt(struct evdev_device *device)
libevdev_get_abs_info(evdev, ABS_MT_POSITION_Y));
}
+static inline void
+evdev_fix_x230_res(struct evdev_device *device)
+{
+ struct libevdev *evdev = device->evdev;
+
+ /* ugly hack while EV_ABS_OVERRIDE is merged in udev */
+
+ if (device->model_lenovo_x230)
+ libevdev_set_abs_resolution(evdev, ABS_Y, 100);
+}
+
static inline int
evdev_check_min_max(struct evdev_device *device, unsigned int code)
{
@@ -1653,6 +1664,8 @@ evdev_configure_device(struct evdev_device *device)
evdev_fix_android_mt(device);
if (libevdev_has_event_code(evdev, EV_ABS, ABS_X)) {
+ evdev_fix_x230_res(device);
+
if (evdev_fix_abs_resolution(device,
ABS_X,
ABS_Y,
--
1.7.1
More information about the wayland-devel
mailing list