Drop capability events

We don't really support devices changing capabilities at runtime. The kernel
has no ability to tell us when this happens on an already-opened device and
the few devices that can literally change physical capabilities (e.g. the
wiimote) open up extra kernel devices instead of modifying the existing one.

Thus, we don't need to notify about devices changing capabilities.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2014-01-09 13:12:23 +10:00
parent 069fc60b8b
commit ab9260c5c7
4 changed files with 0 additions and 120 deletions

View file

@ -574,23 +574,6 @@ evdev_configure_device(struct evdev_device *device)
return 0;
}
static void
register_device_capabilities(struct evdev_device *device)
{
if (device->seat_caps & EVDEV_DEVICE_POINTER) {
device_register_capability(&device->base,
LIBINPUT_DEVICE_CAP_POINTER);
}
if (device->seat_caps & EVDEV_DEVICE_KEYBOARD) {
device_register_capability(&device->base,
LIBINPUT_DEVICE_CAP_KEYBOARD);
}
if (device->seat_caps & EVDEV_DEVICE_TOUCH) {
device_register_capability(&device->base,
LIBINPUT_DEVICE_CAP_TOUCH);
}
}
struct evdev_device *
evdev_device_create(struct libinput_seat *seat,
const char *devnode,
@ -644,7 +627,6 @@ evdev_device_create(struct libinput_seat *seat,
list_insert(seat->devices_list.prev, &device->base.link);
notify_added_device(&device->base);
register_device_capabilities(device);
return device;
@ -698,19 +680,6 @@ evdev_device_has_capability(struct evdev_device *device,
void
evdev_device_remove(struct evdev_device *device)
{
if (device->seat_caps & EVDEV_DEVICE_POINTER) {
device_unregister_capability(&device->base,
LIBINPUT_DEVICE_CAP_POINTER);
}
if (device->seat_caps & EVDEV_DEVICE_KEYBOARD) {
device_unregister_capability(&device->base,
LIBINPUT_DEVICE_CAP_KEYBOARD);
}
if (device->seat_caps & EVDEV_DEVICE_TOUCH) {
device_unregister_capability(&device->base,
LIBINPUT_DEVICE_CAP_TOUCH);
}
if (device->source)
libinput_remove_source(device->base.seat->libinput,
device->source);

View file

@ -118,14 +118,6 @@ notify_added_device(struct libinput_device *device);
void
notify_removed_device(struct libinput_device *device);
void
device_register_capability(struct libinput_device *device,
enum libinput_device_capability capability);
void
device_unregister_capability(struct libinput_device *device,
enum libinput_device_capability capability);
void
keyboard_notify_key(struct libinput_device *device,
uint32_t time,

View file

@ -72,16 +72,6 @@ struct libinput_event_removed_device {
struct libinput_device *device;
};
struct libinput_event_device_register_capability {
struct libinput_event base;
enum libinput_device_capability capability;
};
struct libinput_event_device_unregister_capability {
struct libinput_event base;
enum libinput_device_capability capability;
};
struct libinput_event_keyboard_key {
struct libinput_event base;
uint32_t time;
@ -168,20 +158,6 @@ libinput_event_removed_device_get_device(
return event->device;
}
LIBINPUT_EXPORT enum libinput_device_capability
libinput_event_device_register_capability_get_capability(
struct libinput_event_device_register_capability *event)
{
return event->capability;
}
LIBINPUT_EXPORT enum libinput_device_capability
libinput_event_device_unregister_capability_get_capability(
struct libinput_event_device_unregister_capability *event)
{
return event->capability;
}
LIBINPUT_EXPORT uint32_t
libinput_event_keyboard_key_get_time(
struct libinput_event_keyboard_key *event)
@ -448,8 +424,6 @@ libinput_event_get_class(struct libinput_event *event)
case LIBINPUT_EVENT_REMOVED_DEVICE:
return LIBINPUT_EVENT_CLASS_BASE;
case LIBINPUT_EVENT_DEVICE_REGISTER_CAPABILITY:
case LIBINPUT_EVENT_DEVICE_UNREGISTER_CAPABILITY:
case LIBINPUT_EVENT_KEYBOARD_KEY:
case LIBINPUT_EVENT_POINTER_MOTION:
case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE:
@ -720,40 +694,6 @@ notify_removed_device(struct libinput_device *device)
&removed_device_event->base);
}
void
device_register_capability(struct libinput_device *device,
enum libinput_device_capability capability)
{
struct libinput_event_device_register_capability *capability_event;
capability_event = malloc(sizeof *capability_event);
*capability_event = (struct libinput_event_device_register_capability) {
.capability = capability,
};
post_device_event(device,
LIBINPUT_EVENT_DEVICE_REGISTER_CAPABILITY,
&capability_event->base);
}
void
device_unregister_capability(struct libinput_device *device,
enum libinput_device_capability capability)
{
struct libinput_event_device_unregister_capability *capability_event;
capability_event = malloc(sizeof *capability_event);
*capability_event = (struct libinput_event_device_unregister_capability) {
.capability = capability,
};
post_device_event(device,
LIBINPUT_EVENT_DEVICE_UNREGISTER_CAPABILITY,
&capability_event->base);
}
void
keyboard_notify_key(struct libinput_device *device,
uint32_t time,

View file

@ -128,9 +128,6 @@ enum libinput_event_type {
LIBINPUT_EVENT_ADDED_DEVICE,
LIBINPUT_EVENT_REMOVED_DEVICE,
LIBINPUT_EVENT_DEVICE_REGISTER_CAPABILITY = 200,
LIBINPUT_EVENT_DEVICE_UNREGISTER_CAPABILITY,
LIBINPUT_EVENT_KEYBOARD_KEY = 300,
LIBINPUT_EVENT_POINTER_MOTION = 400,
@ -156,8 +153,6 @@ struct libinput_event_added_seat;
struct libinput_event_removed_seat;
struct libinput_event_added_device;
struct libinput_event_removed_device;
struct libinput_event_device_register_capability;
struct libinput_event_device_unregister_capability;
struct libinput_event_keyboard_key;
struct libinput_event_pointer_motion;
struct libinput_event_pointer_motion_absolute;
@ -274,22 +269,6 @@ struct libinput_device *
libinput_event_removed_device_get_device(
struct libinput_event_removed_device *event);
/**
* @defgroup event_device_register_capability Register device capability event
*/
enum libinput_device_capability
libinput_event_device_register_capability_get_capability(
struct libinput_event_device_register_capability *event);
/**
* @defgroup event_device_unregister_capability Register device capability event
*/
enum libinput_device_capability
libinput_event_device_unregister_capability_get_capability(
struct libinput_event_device_unregister_capability *event);
/**
* @defgroup event_keyboard_key Keyboard key event
*/