diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h index 90cfe7717f..97b184bef4 100644 --- a/src/lib/elput/Elput.h +++ b/src/lib/elput/Elput.h @@ -52,7 +52,14 @@ typedef struct _Elput_Event_Seat_Caps Elput_Seat *seat; } Elput_Event_Seat_Caps; +/* structure to represent event for seat frame */ +typedef struct _Elput_Event_Seat_Frame +{ + Elput_Seat *seat; +} Elput_Event_Seat_Frame; + EAPI extern int ELPUT_EVENT_SEAT_CAPS; +EAPI extern int ELPUT_EVENT_SEAT_FRAME; /** * @file diff --git a/src/lib/elput/elput.c b/src/lib/elput/elput.c index ef2ca6b783..9a673dab6c 100644 --- a/src/lib/elput/elput.c +++ b/src/lib/elput/elput.c @@ -7,6 +7,7 @@ static int _elput_init_count = 0; int _elput_log_dom = -1; EAPI int ELPUT_EVENT_SEAT_CAPS = -1; +EAPI int ELPUT_EVENT_SEAT_FRAME = -1; EAPI int elput_init(void) @@ -26,6 +27,7 @@ elput_init(void) } ELPUT_EVENT_SEAT_CAPS = ecore_event_type_new(); + ELPUT_EVENT_SEAT_FRAME = ecore_event_type_new(); return _elput_init_count; @@ -48,6 +50,7 @@ elput_shutdown(void) if (--_elput_init_count != 0) return _elput_init_count; ELPUT_EVENT_SEAT_CAPS = -1; + ELPUT_EVENT_SEAT_FRAME = -1; eina_log_domain_unregister(_elput_log_dom); _elput_log_dom = -1; diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c index a0dc07e5cd..2036d17546 100644 --- a/src/lib/elput/elput_evdev.c +++ b/src/lib/elput/elput_evdev.c @@ -16,6 +16,18 @@ _seat_caps_update(Elput_Seat *seat) ecore_event_add(ELPUT_EVENT_SEAT_CAPS, ev, NULL, NULL); } +static void +_seat_frame_send(Elput_Seat *seat) +{ + Elput_Event_Seat_Frame *ev; + + ev = calloc(1, sizeof(Elput_Event_Seat_Frame)); + if (!ev) return; + + ev->seat = seat; + ecore_event_add(ELPUT_EVENT_SEAT_FRAME, ev, NULL, NULL); +} + static int _keyboard_fd_get(off_t size) { @@ -373,10 +385,7 @@ _evdev_event_process(struct libinput_event *event) Elput_Device *edev; edev = libinput_device_get_user_data(idev); - if (edev) - { - /* TODO: send seat frame event ?? */ - } + if (edev) _seat_frame_send(edev->seat); } return ret;