raster pushed a commit to branch master.

commit 32b3132c841e8ef22b9428516a7a3f20abb9d746
Author: Ryuan Choi <[email protected]>
Date:   Tue May 21 09:38:19 2013 +0900

    ecore_evas/x: Fixed that cursor object was not disappear
    
    When moved mouse among two objects having cursor set,
    EVAS_CALLBACK_MOUSE_OUT and EVAS_CALLBACK_MOUSE_IN are fired.
    
    I observed that evas_object_del in callback of EVAS_CALLBACK_MOUSE_OUT
    calls EVAS_CALLBACK_MOUSE_IN
    so that newly added cursor object was detached.
---
 src/modules/ecore_evas/engines/x/ecore_evas_x.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c 
b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
index 5f614a7..41cd418 100644
--- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c
+++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
@@ -2628,9 +2628,9 @@ static void
 _ecore_evas_x_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, 
int hot_x, int hot_y)
 {
    int x, y;
+   Evas_Object* old;
 
-   if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
-
+   old = ee->prop.cursor.object;
    if (!obj)
      {
         ee->prop.cursor.object = NULL;
@@ -2638,7 +2638,7 @@ _ecore_evas_x_object_cursor_set(Ecore_Evas *ee, 
Evas_Object *obj, int layer, int
         ee->prop.cursor.hot.x = 0;
         ee->prop.cursor.hot.y = 0;
         ecore_x_window_cursor_show(ee->prop.window, 1);
-        return;
+        goto end;
      }
 
    ee->prop.cursor.object = obj;
@@ -2658,6 +2658,9 @@ _ecore_evas_x_object_cursor_set(Ecore_Evas *ee, 
Evas_Object *obj, int layer, int
      evas_object_show(ee->prop.cursor.object);
 
    evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, 
_ecore_evas_object_cursor_del, ee);
+
+end:
+   if (old) evas_object_del(old);
 }
 
 /*

-- 

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may

Reply via email to