summaryrefslogtreecommitdiff
path: root/src/evdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/evdev.c')
-rw-r--r--src/evdev.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/src/evdev.c b/src/evdev.c
index e2bbdc39..d56a4702 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -289,6 +289,9 @@ evdev_flush_pending_event(struct evdev_device *device, uint64_t time)
case EVDEV_NONE:
return;
case EVDEV_RELATIVE_MOTION:
+ if (!(device->seat_caps & EVDEV_DEVICE_POINTER))
+ break;
+
normalize_delta(device, &device->rel, &unaccel);
raw.x = device->rel.x;
raw.y = device->rel.y;
@@ -297,13 +300,20 @@ evdev_flush_pending_event(struct evdev_device *device, uint64_t time)
/* Use unaccelerated deltas for pointing stick scroll */
if (evdev_post_trackpoint_scroll(device, unaccel, time))
- break;
+ break;
- /* Apply pointer acceleration. */
- accel = filter_dispatch(device->pointer.filter,
- &unaccel,
- device,
- time);
+ if (device->pointer.filter) {
+ /* Apply pointer acceleration. */
+ accel = filter_dispatch(device->pointer.filter,
+ &unaccel,
+ device,
+ time);
+ } else {
+ log_bug_libinput(libinput,
+ "%s: accel filter missing\n",
+ udev_device_get_devnode(device->udev_device));
+ accel = unaccel;
+ }
if (normalized_is_zero(accel) && normalized_is_zero(unaccel))
break;
@@ -2069,11 +2079,6 @@ evdev_configure_device(struct evdev_device *device)
evdev_tag_trackpoint(device, device->udev_device);
device->dpi = evdev_read_dpi_prop(device);
- if (libevdev_has_event_code(evdev, EV_REL, REL_X) &&
- libevdev_has_event_code(evdev, EV_REL, REL_Y) &&
- evdev_init_accel(device, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE) == -1)
- return -1;
-
device->seat_caps |= EVDEV_DEVICE_POINTER;
log_info(libinput,
@@ -2111,6 +2116,16 @@ evdev_configure_device(struct evdev_device *device)
device->devname, devnode);
}
+ if (device->seat_caps & EVDEV_DEVICE_POINTER &&
+ libevdev_has_event_code(evdev, EV_REL, REL_X) &&
+ libevdev_has_event_code(evdev, EV_REL, REL_Y) &&
+ evdev_init_accel(device, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE) == -1) {
+ log_error(libinput,
+ "failed to initialize pointer acceleration for %s\n",
+ device->devname);
+ return -1;
+ }
+
return 0;
}