tp_resume(tp, device);
}
-static void
-tp_interface_tag_device(struct evdev_device *device,
- struct udev_device *udev_device)
+void
+evdev_tag_touchpad(struct evdev_device *device,
+ struct udev_device *udev_device)
{
int bustype;
tp_interface_device_removed,
tp_interface_device_removed, /* device_suspended, treat as remove */
tp_interface_device_added, /* device_resumed, treat as add */
- tp_interface_tag_device,
};
static void
int bustype;
bustype = libevdev_get_id_bustype(device->evdev);
- if (bustype == BUS_USB || bustype == BUS_BLUETOOTH) {
- if (device->seat_caps & EVDEV_DEVICE_POINTER)
- device->tags |= EVDEV_TAG_EXTERNAL_MOUSE;
- }
+ if (bustype == BUS_USB || bustype == BUS_BLUETOOTH)
+ device->tags |= EVDEV_TAG_EXTERNAL_MOUSE;
}
static void
free(dispatch);
}
-static void
-fallback_tag_device(struct evdev_device *device,
- struct udev_device *udev_device)
-{
- evdev_tag_external_mouse(device, udev_device);
- evdev_tag_trackpoint(device, udev_device);
- evdev_tag_keyboard(device, udev_device);
-}
-
static int
evdev_calibration_has_matrix(struct libinput_device *libinput_device)
{
NULL, /* device_removed */
NULL, /* device_suspended */
NULL, /* device_resumed */
- fallback_tag_device,
};
static uint32_t
!libevdev_has_event_code(evdev, EV_ABS, ABS_MT_SLOT));
}
-static void
-evdev_tag_device(struct evdev_device *device)
-{
- if (device->dispatch->interface->tag_device)
- device->dispatch->interface->tag_device(device,
- device->udev_device);
-}
-
static inline int
evdev_read_wheel_click_prop(struct evdev_device *device)
{
log_info(libinput,
"input device '%s', %s is a touchpad\n",
device->devname, devnode);
+
+ evdev_tag_touchpad(device, device->udev_device);
return device->dispatch == NULL ? -1 : 0;
}
device->scroll.natural_scrolling_enabled = true;
/* want button scrolling config option */
device->scroll.want_button = 1;
+
+ evdev_tag_external_mouse(device, device->udev_device);
+ evdev_tag_trackpoint(device, device->udev_device);
}
if (udev_tags & EVDEV_UDEV_TAG_KEYBOARD) {
device->scroll.natural_scrolling_enabled = true;
device->seat_caps |= EVDEV_DEVICE_POINTER;
}
+
+ evdev_tag_keyboard(device, device->udev_device);
}
if (udev_tags & EVDEV_UDEV_TAG_TOUCHSCREEN) {
list_insert(seat->devices_list.prev, &device->base.link);
- evdev_tag_device(device);
evdev_notify_added_device(device);
return device;
/* A device was resumed */
void (*device_resumed)(struct evdev_device *device,
struct evdev_device *resumed_device);
-
- /* Tag device with one of EVDEV_TAG */
- void (*tag_device)(struct evdev_device *device,
- struct udev_device *udev_device);
};
struct evdev_dispatch {
evdev_mt_touchpad_create(struct evdev_device *device);
void
+evdev_tag_touchpad(struct evdev_device *device,
+ struct udev_device *udev_device);
+
+void
evdev_device_led_update(struct evdev_device *device, enum libinput_led leds);
int