Add a helper function for initializing an event listener

Not needed right now as everything assumes the listener was added before it
was removed. This helper is for the cases where we may call listener_remove
before it was ever added.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2017-01-25 15:19:50 +10:00
parent e6806ce292
commit d17e84fc0f
2 changed files with 9 additions and 0 deletions

View file

@ -466,6 +466,9 @@ void
libinput_device_set_device_group(struct libinput_device *device,
struct libinput_device_group *group);
void
libinput_device_init_event_listener(struct libinput_event_listener *listener);
void
libinput_device_add_event_listener(struct libinput_device *device,
struct libinput_event_listener *listener,

View file

@ -1944,6 +1944,12 @@ libinput_dispatch(struct libinput *libinput)
return 0;
}
void
libinput_device_init_event_listener(struct libinput_event_listener *listener)
{
list_init(&listener->link);
}
void
libinput_device_add_event_listener(struct libinput_device *device,
struct libinput_event_listener *listener,