if ((device->caps & (EVDEV_MOTION_ABS | EVDEV_MOTION_REL)) &&
(device->caps & EVDEV_BUTTON)) {
weston_seat_init_pointer(device->seat);
+ device->seat_caps |= EVDEV_SEAT_POINTER;
weston_log("input device %s, %s is a pointer caps =%s%s%s\n",
device->devname, device->devnode,
device->caps & EVDEV_MOTION_ABS ? " absolute-motion" : "",
if ((device->caps & EVDEV_KEYBOARD)) {
if (weston_seat_init_keyboard(device->seat, NULL) < 0)
return -1;
+ device->seat_caps |= EVDEV_SEAT_KEYBOARD;
weston_log("input device %s, %s is a keyboard\n",
device->devname, device->devnode);
}
if ((device->caps & EVDEV_TOUCH)) {
weston_seat_init_touch(device->seat);
+ device->seat_caps |= EVDEV_SEAT_TOUCH;
weston_log("input device %s, %s is a touch device\n",
device->devname, device->devnode);
}
container_of(ec->output_list.next, struct weston_output, link);
device->seat = seat;
+ device->seat_caps = 0;
device->is_mt = 0;
device->mtdev = NULL;
device->devnode = strdup(path);
{
struct evdev_dispatch *dispatch;
+ if (device->seat_caps & EVDEV_SEAT_POINTER)
+ weston_seat_release_pointer(device->seat);
+ if (device->seat_caps & EVDEV_SEAT_KEYBOARD)
+ weston_seat_release_keyboard(device->seat);
+ if (device->seat_caps & EVDEV_SEAT_TOUCH)
+ weston_seat_release_touch(device->seat);
+
dispatch = device->dispatch;
if (dispatch)
dispatch->interface->destroy(dispatch);
EVDEV_TOUCH = (1 << 4),
};
+enum evdev_device_seat_capability {
+ EVDEV_SEAT_POINTER = (1 << 0),
+ EVDEV_SEAT_KEYBOARD = (1 << 1),
+ EVDEV_SEAT_TOUCH = (1 << 2)
+};
+
struct evdev_device {
struct weston_seat *seat;
struct wl_list link;
enum evdev_event_type pending_event;
enum evdev_device_capability caps;
+ enum evdev_device_seat_capability seat_caps;
int is_mt;
};