]>
Commit | Line | Data |
---|---|---|
8ad3d608 AM |
1 | From 3d6afca975e5c54d458974ca2e9ada3df209587c Mon Sep 17 00:00:00 2001 |
2 | From: Peter Hutterer <peter.hutterer@who-t.net> | |
3 | Date: Wed, 20 May 2015 13:22:45 +1000 | |
4 | Subject: [PATCH xf86-input-libinput] Only init abs axes if we don't have | |
5 | acceleration | |
6 | ||
7 | A lot of devices (mainly MS input devices) have abs axes on top of the | |
8 | relative axes. Those axes are usually mute but with the current code we set up | |
9 | absolute axes for those devices. Relative events are then scaled by the server | |
10 | which makes the device appear slow. | |
11 | ||
12 | As an immediate fix always prefer relative axes and only set up absolute axes | |
13 | if the device has a calibration matrix but no pointer acceleration. | |
14 | This may mess up other devices where the relative axes are dead, we'll deal | |
15 | with this when it comes. | |
16 | ||
17 | https://bugs.freedesktop.org/show_bug.cgi?id=90322 | |
18 | ||
19 | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | |
20 | Reviewed-by: Hans de Goede <hdegoede@redhat.com> | |
21 | --- | |
22 | src/libinput.c | 14 +++++++++++++- | |
23 | 1 file changed, 13 insertions(+), 1 deletion(-) | |
24 | ||
25 | diff --git a/src/libinput.c b/src/libinput.c | |
26 | index 3e54529..c8669fc 100644 | |
27 | --- a/src/libinput.c | |
28 | +++ b/src/libinput.c | |
29 | @@ -85,6 +85,8 @@ struct xf86libinput { | |
30 | double y_remainder; | |
31 | } scale; | |
32 | ||
33 | + BOOL has_abs; | |
34 | + | |
35 | ValuatorMask *valuators; | |
36 | ||
37 | struct options { | |
38 | @@ -526,6 +528,8 @@ xf86libinput_init_pointer_absolute(InputInfoPtr pInfo) | |
39 | SetScrollValuator(dev, 2, SCROLL_TYPE_HORIZONTAL, driver_data->scroll.hdist, 0); | |
40 | SetScrollValuator(dev, 3, SCROLL_TYPE_VERTICAL, driver_data->scroll.vdist, 0); | |
41 | ||
42 | + driver_data->has_abs = TRUE; | |
43 | + | |
44 | return Success; | |
45 | } | |
46 | static void | |
47 | @@ -636,7 +640,8 @@ xf86libinput_init(DeviceIntPtr dev) | |
48 | if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD)) | |
49 | xf86libinput_init_keyboard(pInfo); | |
50 | if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER)) { | |
51 | - if (libinput_device_config_calibration_has_matrix(device)) | |
52 | + if (libinput_device_config_calibration_has_matrix(device) && | |
53 | + !libinput_device_config_accel_is_available(device)) | |
54 | xf86libinput_init_pointer_absolute(pInfo); | |
55 | else | |
56 | xf86libinput_init_pointer(pInfo); | |
57 | @@ -709,6 +714,13 @@ xf86libinput_handle_absmotion(InputInfoPtr pInfo, struct libinput_event_pointer | |
58 | ValuatorMask *mask = driver_data->valuators; | |
59 | double x, y; | |
60 | ||
61 | + if (!driver_data->has_abs) { | |
62 | + xf86IDrvMsg(pInfo, X_ERROR, | |
63 | + "Discarding absolute event from relative device. " | |
64 | + "Please file a bug\n"); | |
65 | + return; | |
66 | + } | |
67 | + | |
68 | x = libinput_event_pointer_get_absolute_x_transformed(event, TOUCH_AXIS_MAX); | |
69 | y = libinput_event_pointer_get_absolute_y_transformed(event, TOUCH_AXIS_MAX); | |
70 | ||
71 | -- | |
72 | 2.3.5 | |
73 |