diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index eed6660c7e..294af10b5a 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -1485,6 +1485,31 @@ EAPI Eina_Bool ecore_wl2_input_pointer_xy_get(const Ecore_Wl2_Input *input, int */ EAPI void ecore_wl2_input_pointer_set(Ecore_Wl2_Input *input, struct wl_surface *surface, int hot_x, int hot_y); +/** + * Set a specific cursor on a given seat + * + * @brief This function will try to find a matching cursor inside the existing + * cursor theme and set the pointer for the specified seat to be + * the specified cursor + * + * @param input The seat to set the cursor on + * @param cursor The name of the cursor to try and set + * + * @ingroup Ecore_Wl2_Input_Group + * @since 1.20 + */ +EAPI void ecore_wl2_input_cursor_from_name_set(Ecore_Wl2_Input *input, const char *cursor); + +/** + * Gets default input of a given display + * + * @param display The display + * + * @ingroup Ecore_Wl2_Input_Group + * @since 1.24 + */ +EAPI Ecore_Wl2_Input *ecore_wl2_input_default_input_get(const Ecore_Wl2_Display *ewd); + /** * @defgroup Ecore_Wl2_Output_Group Wayland Library Output 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 92cc9a52bd..75a7366f82 100644 --- a/src/lib/ecore_wl2/ecore_wl2_input.c +++ b/src/lib/ecore_wl2/ecore_wl2_input.c @@ -1871,3 +1871,17 @@ ecore_wl2_input_pointer_xy_get(const Ecore_Wl2_Input *input, int *x, int *y) if (y) *y = input->pointer.sy; return EINA_TRUE; } + +EAPI Ecore_Wl2_Input * +ecore_wl2_input_default_input_get(const Ecore_Wl2_Display *ewd) +{ + Ecore_Wl2_Input *input; + + EINA_SAFETY_ON_NULL_RETURN_VAL(ewd, NULL); + EINA_SAFETY_ON_NULL_RETURN_VAL(ewd->inputs, NULL); + + input = ecore_wl2_display_input_find_by_name(ewd, "seat0"); + if (!input) input = ecore_wl2_display_input_find_by_name(ewd, "default"); + + return input; +}