mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-25 07:00:06 +01:00
udev: copy the trackpoint sensitivity directly from sysfs
Rather than going the roundabout way of having systemd set the sensitivity followed by us reading that udev property and hoping, just take the sensitivity directly from sysfs. This makes us basically independent of what systemd does (or the lack of systemd, where that is a problem). It does remove the chance of users to trick libinput by manually adjusting the sensitivity after the udev rules kicked in, but seriously, we should work on fixing acceleration properly in that case. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
3d81f1179f
commit
a4036a33ca
2 changed files with 6 additions and 2 deletions
|
|
@ -1220,7 +1220,7 @@ evdev_get_trackpoint_range(struct evdev_device *device)
|
|||
HTTP_DOC_LINK);
|
||||
|
||||
prop = udev_device_get_property_value(device->udev_device,
|
||||
"POINTINGSTICK_SENSITIVITY");
|
||||
"LIBINPUT_ATTR_TRACKPOINT_SENSITIVITY");
|
||||
if (prop) {
|
||||
int sensitivity;
|
||||
|
||||
|
|
@ -1236,7 +1236,7 @@ evdev_get_trackpoint_range(struct evdev_device *device)
|
|||
sensitivity/DEFAULT_TRACKPOINT_SENSITIVITY;
|
||||
|
||||
evdev_log_debug(device,
|
||||
"trackpoint udev sensitivity is %d\n",
|
||||
"trackpoint sensitivity is %d\n",
|
||||
sensitivity);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,4 +48,8 @@ KERNELS=="input*", \
|
|||
KERNELS=="input*", \
|
||||
IMPORT{builtin}="hwdb 'libinput:name:$attr{name}:dt:$attr{[devicetree/base]model}'"
|
||||
|
||||
ENV{ID_INPUT_POINTINGSTICK}=="1", \
|
||||
ATTRS{sensitivity}=="?*", \
|
||||
ENV{LIBINPUT_ATTR_TRACKPOINT_SENSITIVITY}="$attr{sensitivity}"
|
||||
|
||||
LABEL="libinput_model_quirks_end"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue