cursor object changes are now rejected if creating the new cursor fails
authorMike Blumenkrantz <zmike@osg.samsung.com>
Thu, 5 Mar 2015 16:33:57 +0000 (11:33 -0500)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Thu, 5 Mar 2015 16:33:57 +0000 (11:33 -0500)
previous behavior resulted in a deleted cursor

legacy/elementary/src/lib/els_cursor.c

index 0825d56..3e18fde 100644 (file)
@@ -239,17 +239,19 @@ _elm_cursor_set(Elm_Cursor *cur)
    if (cur->visible) return;
 
    evas_event_freeze(cur->evas);
-   cur->visible = EINA_TRUE;
    if (!cur->use_engine)
      {
         if (!cur->obj)
           _elm_cursor_obj_add(cur->eventarea, cur);
-        ecore_evas_object_cursor_set(cur->ee, cur->obj,
-                                     ELM_OBJECT_LAYER_CURSOR, cur->hot_x,
-                                     cur->hot_y);
+        if (cur->obj)
+          ecore_evas_object_cursor_set(cur->ee, cur->obj,
+                                       ELM_OBJECT_LAYER_CURSOR, cur->hot_x,
+                                       cur->hot_y);
+        cur->visible = !!cur->obj;
      }
    else
      {
+        cur->visible = EINA_TRUE;
         if (cur->obj)
           {
              evas_object_del(cur->obj);