evdev: only read the trackpoint multiplier on trackpoints

Check the tag before we read any multiplier quirks. And don't bother
reading the DPI for trackpoints either because it doesn't make sense for
those devices.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2022-12-01 11:40:35 +10:00
parent 3fd9b3fbc6
commit 38dbfe41a1

View file

@ -2056,8 +2056,10 @@ evdev_configure_device(struct evdev_device *device)
udev_tags & EVDEV_UDEV_TAG_POINTINGSTICK) {
evdev_tag_external_mouse(device, device->udev_device);
evdev_tag_trackpoint(device, device->udev_device);
device->dpi = evdev_read_dpi_prop(device);
device->trackpoint_multiplier = evdev_get_trackpoint_multiplier(device);
if (device->tags & EVDEV_TAG_TRACKPOINT)
device->trackpoint_multiplier = evdev_get_trackpoint_multiplier(device);
else
device->dpi = evdev_read_dpi_prop(device);
/* whether velocity should be averaged, false by default */
device->use_velocity_averaging = evdev_need_velocity_averaging(device);