From a993008380e7bb06070a338d62ab966d472f18ae Mon Sep 17 00:00:00 2001 From: "duna.oh" Date: Mon, 21 Aug 2023 15:16:17 +0900 Subject: [PATCH] ecore_wl2: add cursor_visible set API @tizen_only Change-Id: I4f766537beb4c85f44ef7ae9788a37c2e435971d --- src/lib/ecore_wl2/Ecore_Wl2.h | 3 +++ src/lib/ecore_wl2/ecore_wl2_input.c | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index 7082e5c..e9364df 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -2634,6 +2634,9 @@ EAPI Eina_Bool ecore_wl2_window_pointer_constraints_lock_pointer(Ecore_Wl2_Windo EAPI Eina_Bool ecore_wl2_window_pointer_constraints_unlock_pointer(Ecore_Wl2_Window *win); EAPI void ecore_wl2_window_locked_pointer_region_set(Ecore_Wl2_Window *win, int x, int y, int w, int h); EAPI void ecore_wl2_window_locked_pointer_cursor_position_hint_set(Ecore_Wl2_Window *win, int x, int y); + +// TIZEN_ONLY(20230821) : add cursor_visible set API +EAPI void ecore_wl2_window_cursor_visible_set(Ecore_Wl2_Window *win, Eina_Bool visible); // # undef EAPI diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c index 6081110..c2c27c9 100644 --- a/src/lib/ecore_wl2/ecore_wl2_input.c +++ b/src/lib/ecore_wl2/ecore_wl2_input.c @@ -4274,3 +4274,28 @@ ecore_wl2_window_locked_pointer_cursor_position_hint_set(Ecore_Wl2_Window *win, wl_fixed_from_int(y)); } // + +// TIZEN_ONLY(20230821) : add cursor_visible set API +EAPI void +ecore_wl2_window_cursor_visible_set(Ecore_Wl2_Window *win, Eina_Bool visible) +{ + Ecore_Wl2_Display *ewd; + Ecore_Wl2_Input *input; + + EINA_SAFETY_ON_NULL_RETURN(win); + + ewd = win->display; + input = ecore_wl2_input_default_input_get(ewd); + EINA_SAFETY_ON_NULL_RETURN(input); + + INF("Set cursor_visible to %s", visible ? "True" : "False"); + if (visible) + { + ecore_wl2_input_cursor_from_name_set(input, input->cursor.name); + } + else + { + ecore_wl2_input_pointer_set(input, NULL, 0, 0); + } +} +// -- 2.7.4