Merge the device added/removed events into a single device notify event
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 15 Jan 2014 07:10:30 +0000 (17:10 +1000)
committerJonas Ådahl <jadahl@gmail.com>
Tue, 21 Jan 2014 21:50:59 +0000 (22:50 +0100)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/libinput.c
src/libinput.h

index e668140a80e1e4fbf5f11b92a348fe1e373421c0..65bfa74160da47de0e326733584027f736ee5004 100644 (file)
@@ -53,12 +53,7 @@ struct libinput_event {
        struct libinput_device *device;
 };
 
-struct libinput_event_added_device {
-       struct libinput_event base;
-       struct libinput_device *device;
-};
-
-struct libinput_event_removed_device {
+struct libinput_event_device_notify {
        struct libinput_event base;
        struct libinput_device *device;
 };
@@ -598,13 +593,13 @@ post_device_event(struct libinput_device *device,
 void
 notify_added_device(struct libinput_device *device)
 {
-       struct libinput_event_added_device *added_device_event;
+       struct libinput_event_device_notify *added_device_event;
 
        added_device_event = malloc(sizeof *added_device_event);
        if (!added_device_event)
                return;
 
-       *added_device_event = (struct libinput_event_added_device) {
+       *added_device_event = (struct libinput_event_device_notify) {
                .device = device,
        };
 
@@ -616,13 +611,13 @@ notify_added_device(struct libinput_device *device)
 void
 notify_removed_device(struct libinput_device *device)
 {
-       struct libinput_event_removed_device *removed_device_event;
+       struct libinput_event_device_notify *removed_device_event;
 
        removed_device_event = malloc(sizeof *removed_device_event);
        if (!removed_device_event)
                return;
 
-       *removed_device_event = (struct libinput_event_removed_device) {
+       *removed_device_event = (struct libinput_event_device_notify) {
                .device = device,
        };
 
index 5f85992632211f3af3405485d0da16e7ff606bea..d6c75972cbcb0b8218cd629649ef0a420b4b82b8 100644 (file)
@@ -142,8 +142,7 @@ struct libinput_device;
 struct libinput_seat;
 
 struct libinput_event;
-struct libinput_event_added_device;
-struct libinput_event_removed_device;
+struct libinput_event_device_notify;
 struct libinput_event_keyboard_key;
 struct libinput_event_pointer_motion;
 struct libinput_event_pointer_motion_absolute;