summaryrefslogtreecommitdiff
path: root/src/modules/ecore_evas/engines/win32
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-04-02 20:29:03 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-04-02 20:47:28 +0900
commit165efe2254ecd352011d28a351cd874c6eb0a181 (patch)
tree49748b405e21559aeebb16579b59d4a22dc4bd32 /src/modules/ecore_evas/engines/win32
parent2de5aaefac082cacb35aefd0907118b1fce9626f (diff)
ecore-evas - fix object cursor to not delete the same cursor when set
this fixes a misbehavior with ecore evas object cursors when you set one, the old one is deleted, but if the old is the same, the new one you set gets deleted, rather than just updated. @fix
Diffstat (limited to 'src/modules/ecore_evas/engines/win32')
-rw-r--r--src/modules/ecore_evas/engines/win32/ecore_evas_win32.c47
1 files changed, 32 insertions, 15 deletions
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 2ff8998f8b..93f87d2040 100644
--- a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
+++ b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
@@ -809,39 +809,56 @@ _ecore_evas_win32_size_step_set(Ecore_Evas *ee, int width, int height)
809} 809}
810 810
811static void 811static void
812_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
813{
814 Ecore_Evas *ee;
815
816 ee = data;
817 if (ee) ee->prop.cursor.object = NULL;
818}
819
820static void
812_ecore_evas_win32_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y) 821_ecore_evas_win32_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
813{ 822{
814#if 0
815 int x, y; 823 int x, y;
816 824 Evas_Object *old;
817 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object); 825
818 826 old = ee->prop.cursor.object;
819 if (obj == NULL) 827 if (obj == NULL)
820 { 828 {
821 ee->prop.cursor.object = NULL; 829 ee->prop.cursor.object = NULL;
822 ee->prop.cursor.layer = 0; 830 ee->prop.cursor.layer = 0;
823 ee->prop.cursor.hot.x = 0; 831 ee->prop.cursor.hot.x = 0;
824 ee->prop.cursor.hot.y = 0; 832 ee->prop.cursor.hot.y = 0;
825 ecore_win32_window_cursor_show(ee->prop.window, 1); 833 goto end;
826 return;
827 } 834 }
828 835
829 ee->prop.cursor.object = obj; 836 ee->prop.cursor.object = obj;
830 ee->prop.cursor.layer = layer; 837 ee->prop.cursor.layer = layer;
831 ee->prop.cursor.hot.x = hot_x; 838 ee->prop.cursor.hot.x = hot_x;
832 ee->prop.cursor.hot.y = hot_y; 839 ee->prop.cursor.hot.y = hot_y;
833 840
834 ecore_win32_window_cursor_show(ee->prop.window, 0); 841 if (obj != old)
835 842 {
836 evas_pointer_output_xy_get(ee->evas, &x, &y); 843 ecore_win32_window_cursor_show(ee->prop.window, 0);
837 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer); 844 evas_pointer_output_xy_get(ee->evas, &x, &y);
845 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
846 evas_object_pass_events_set(ee->prop.cursor.object, 1);
847 if (evas_pointer_inside_get(ee->evas))
848 evas_object_show(ee->prop.cursor.object);
849 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
850 _ecore_evas_object_cursor_del, ee);
851 }
838 evas_object_move(ee->prop.cursor.object, 852 evas_object_move(ee->prop.cursor.object,
839 x - ee->prop.cursor.hot.x, 853 x - ee->prop.cursor.hot.x,
840 y - ee->prop.cursor.hot.y); 854 y - ee->prop.cursor.hot.y);
841 evas_object_pass_events_set(ee->prop.cursor.object, 1); 855end:
842 if (evas_pointer_inside_get(ee->evas)) 856 if ((old) && (obj != old))
843 evas_object_show(ee->prop.cursor.object); 857 {
844#endif 858 evas_object_event_callback_del_full
859 (old, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
860 evas_object_del(old);
861 }
845} 862}
846 863
847static void 864static void