struct libinput_event {
enum libinput_event_type type;
+ struct libinput *libinput;
union libinput_event_target target;
};
return event->target;
}
+LIBINPUT_EXPORT struct libinput*
+libinput_event_get_context(struct libinput_event *event)
+{
+ return event->libinput;
+}
+
LIBINPUT_EXPORT struct libinput_seat *
libinput_event_added_seat_get_seat(struct libinput_event_added_seat *event)
{
static void
init_event_base(struct libinput_event *event,
+ struct libinput *libinput,
enum libinput_event_type type,
union libinput_event_target target)
{
event->type = type;
+ event->libinput = libinput;
event->target = target;
}
enum libinput_event_type type,
struct libinput_event *event)
{
- init_event_base(event, type,
+ init_event_base(event, libinput, type,
(union libinput_event_target) { .libinput = libinput });
libinput_post_event(libinput, event);
}
enum libinput_event_type type,
struct libinput_event *event)
{
- init_event_base(event, type,
+ init_event_base(event, device->seat->libinput, type,
(union libinput_event_target) { .device = device });
libinput_post_event(device->seat->libinput, event);
}
libinput_event_get_target(struct libinput_event *event);
/**
+ * @ingroup event
+ *
+ * Get the libinput context from the event.
+ *
+ * @param event The libinput event
+ * @return The libinput context for this event.
+ */
+struct libinput*
+libinput_event_get_context(struct libinput_event *event);
+
+/**
* @defgroup event_added_seat Added seat event
*/