ecore_wl2: add cursor_visible set API 07/297507/2 accepted/tizen/unified/20230822.162245
authorduna.oh <duna.oh@samsung.com>
Mon, 21 Aug 2023 06:16:17 +0000 (15:16 +0900)
committerduna.oh <duna.oh@samsung.com>
Mon, 21 Aug 2023 06:35:37 +0000 (15:35 +0900)
@tizen_only

Change-Id: I4f766537beb4c85f44ef7ae9788a37c2e435971d

src/lib/ecore_wl2/Ecore_Wl2.h
src/lib/ecore_wl2/ecore_wl2_input.c

index 7082e5c..e9364df 100644 (file)
@@ -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
index 6081110..c2c27c9 100644 (file)
@@ -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);
+     }
+}
+//