From f98d427713413d63296d9f77f822ac8031914875 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 15 Jan 2014 17:10:30 +1000 Subject: [PATCH] Merge the device added/removed events into a single device notify event Signed-off-by: Peter Hutterer --- src/libinput.c | 15 +++++---------- src/libinput.h | 3 +-- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/libinput.c b/src/libinput.c index e668140a..65bfa741 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -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, }; diff --git a/src/libinput.h b/src/libinput.h index 5f859926..d6c75972 100644 --- a/src/libinput.h +++ b/src/libinput.h @@ -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;