diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index e51c7a2591..e607f7fd3b 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -943,6 +943,14 @@ EAPI Ecore_Wl2_Seat_Capabilities ecore_wl2_input_seat_capabilities_get(Ecore_Wl2 */ EAPI unsigned int ecore_wl2_input_seat_id_get(Ecore_Wl2_Input *input); +/** + * Get the name of an input + * @param input The input + * @return The name + * @since 1.20 + */ +EAPI Eina_Stringshare *ecore_wl2_input_name_get(Ecore_Wl2_Input *input); + /** * @defgroup Ecore_Wl2_Dnd_Group Wayland Library Drag-n-Drop Functions * @ingroup Ecore_Wl2_Group diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c index b95fbd6145..29b53a9f4d 100644 --- a/src/lib/ecore_wl2/ecore_wl2_input.c +++ b/src/lib/ecore_wl2/ecore_wl2_input.c @@ -1281,6 +1281,7 @@ _seat_cb_name(void *data, struct wl_seat *seat EINA_UNUSED, const char *name) Ecore_Wl2_Input *input; input = data; + eina_stringshare_replace(&input->name, name); ev = calloc(1, sizeof(Ecore_Wl2_Event_Seat_Name)); EINA_SAFETY_ON_NULL_RETURN(ev); @@ -1518,6 +1519,7 @@ _ecore_wl2_input_del(Ecore_Wl2_Input *input) EINA_INLIST_FOREACH(display->windows, window) if (window->input == input) window->input = NULL; + eina_stringshare_replace(&input->name, NULL); free(input); } @@ -1593,6 +1595,13 @@ ecore_wl2_input_seat_capabilities_get(Ecore_Wl2_Input *input) return cap; } +EAPI Eina_Stringshare * +ecore_wl2_input_name_get(Ecore_Wl2_Input *input) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(input, NULL); + return input->name; +} + EAPI unsigned int ecore_wl2_input_seat_id_get(Ecore_Wl2_Input *input) { diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h b/src/lib/ecore_wl2/ecore_wl2_private.h index 90fa3a5d02..4e420b548d 100644 --- a/src/lib/ecore_wl2/ecore_wl2_private.h +++ b/src/lib/ecore_wl2/ecore_wl2_private.h @@ -419,6 +419,7 @@ struct _Ecore_Wl2_Input unsigned int seat_version; unsigned int id; + Eina_Stringshare *name; Ecore_Event_Handler *dev_add_handler; Ecore_Event_Handler *dev_remove_handler;