bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=bdb62b6bbecb8beb6ef64c74a708ee1f8e384be7

commit bdb62b6bbecb8beb6ef64c74a708ee1f8e384be7
Author: Vincent Torri <[email protected]>
Date:   Fri Jul 7 16:54:34 2017 +0200

    Add ecore_win32_cursor_show() API and ecore_evas_win32_cursor_(un)set() 
functions
    
    This fixes double mouse cursor in elm entries on Windows (for example)
    
    @feature
    @fix
---
 src/lib/ecore_win32/Ecore_Win32.h                    |  2 ++
 src/lib/ecore_win32/ecore_win32_cursor.c             |  8 ++++++++
 .../ecore_evas/engines/win32/ecore_evas_win32.c      | 20 ++++++++++++++++++--
 3 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/src/lib/ecore_win32/Ecore_Win32.h 
b/src/lib/ecore_win32/Ecore_Win32.h
index 34e8596fdb..356200ff4a 100644
--- a/src/lib/ecore_win32/Ecore_Win32.h
+++ b/src/lib/ecore_win32/Ecore_Win32.h
@@ -675,6 +675,8 @@ EAPI const Ecore_Win32_Cursor 
*ecore_win32_cursor_x11_shaped_get(Ecore_Win32_Cur
 
 EAPI void                ecore_win32_cursor_size_get(int *width, int *height);
 
+EAPI void                ecore_win32_cursor_show(Eina_Bool show);
+
 
 
 /* Drag and drop */
diff --git a/src/lib/ecore_win32/ecore_win32_cursor.c 
b/src/lib/ecore_win32/ecore_win32_cursor.c
index cb95a53cc7..490e4f4ec9 100644
--- a/src/lib/ecore_win32/ecore_win32_cursor.c
+++ b/src/lib/ecore_win32/ecore_win32_cursor.c
@@ -355,6 +355,14 @@ ecore_win32_cursor_size_get(int *width, int *height)
    if (*height) *height = GetSystemMetrics(SM_CYCURSOR);
 }
 
+EAPI void
+ecore_win32_cursor_show(Eina_Bool show)
+{
+   INF("show cursor");
+
+   ShowCursor(show ? TRUE : FALSE);
+}
+
 /**
  * @}
  */
diff --git a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c 
b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
index 2cdc1b58f2..2f8a6844e4 100644
--- a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
+++ b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
@@ -909,6 +909,22 @@ _ecore_evas_win32_size_step_set(Ecore_Evas *ee, int width, 
int height)
 }
 
 static void
+_ecore_evas_win32_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj,
+                                    int layer EINA_UNUSED,
+                                    int hot_x EINA_UNUSED,
+                                    int hot_y EINA_UNUSED)
+{
+   if (obj != _ecore_evas_default_cursor_image_get(ee))
+     ecore_win32_cursor_show(EINA_FALSE);
+}
+
+static void
+_ecore_evas_win32_object_cursor_unset(Ecore_Evas *ee)
+{
+   ecore_win32_cursor_show(EINA_TRUE);
+}
+
+static void
 _ecore_evas_win32_focus_set(Ecore_Evas *ee, Eina_Bool on EINA_UNUSED)
 {
    ecore_win32_window_focus((Ecore_Win32_Window *)ee->prop.window);
@@ -1212,8 +1228,8 @@ static Ecore_Evas_Engine_Func _ecore_win32_engine_func =
      _ecore_evas_win32_size_max_set,
      _ecore_evas_win32_size_base_set,
      _ecore_evas_win32_size_step_set,
-     NULL,
-     NULL,
+     _ecore_evas_win32_object_cursor_set,
+     _ecore_evas_win32_object_cursor_unset,
      NULL, /* _ecore_evas_x_layer_set */
      _ecore_evas_win32_focus_set,
      _ecore_evas_win32_iconified_set,

-- 


Reply via email to