aaah safety delete - nash nash nash. for you.
authorCarsten Haitzler <raster@rasterman.com>
Thu, 24 Jun 2010 02:54:03 +0000 (02:54 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Thu, 24 Jun 2010 02:54:03 +0000 (02:54 +0000)
SVN revision: 49825

src/lib/elm_entry.c
src/lib/elm_widget.c

index cd31140ef0c0d7592dfd86e25aece640cc9d4904..7327c5a92daf4a91e9837a809cf97617499733d3 100644 (file)
@@ -107,6 +107,7 @@ struct _Widget_Data
    Evas_Coord cx, cy, cw, ch;
    Eina_List *items;
    Eina_List *item_providers;
+   Ecore_Job *hovdeljob;
    Mod_Api *api; // module api if supplied
    Eina_Bool changed : 1;
    Eina_Bool linewrap : 1;
@@ -227,6 +228,7 @@ _del_hook(Evas_Object *obj)
    Elm_Entry_Context_Menu_Item *it;
    Elm_Entry_Item_Provider *ip;
 
+   if (wd->hovdeljob) ecore_job_del(wd->hovdeljob);
    if ((wd->api) && (wd->api->obj_unhook)) wd->api->obj_unhook(obj); // module - unhook
 
    entries = eina_list_remove(entries, obj);
@@ -411,10 +413,24 @@ _resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event
 }
 
 static void
-_dismissed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+_hover_del(void *data)
 {
    Widget_Data *wd = elm_widget_data_get(data);
    if (!wd) return;
+   
+   if (wd->hoversel)
+     {
+        evas_object_del(wd->hoversel);
+        wd->hoversel = NULL;
+     }
+   wd->hovdeljob = NULL;
+}
+
+static void
+_dismissed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+   Widget_Data *wd = elm_widget_data_get(data);
+   if (!wd) return; 
    if (wd->hoversel) evas_object_hide(wd->hoversel);
    if (wd->selmode)
      {
@@ -422,11 +438,8 @@ _dismissed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
           edje_object_part_text_select_allow_set(wd->ent, "elm.text", 1);
      }
    elm_widget_scroll_freeze_pop(data);
-   if (wd->hoversel)
-     {
-        evas_object_del(wd->hoversel);
-        wd->hoversel = NULL;
-     }
+   if (wd->hovdeljob) ecore_job_del(wd->hovdeljob);
+   wd->hovdeljob = ecore_job_add(_hover_del, data);
 }
 
 static void
index 176b5c0f365852e4b1135247a47da64a3c612dcc..a44de299a1fd60cbc736a2ed807a4284ef56096b 100644 (file)
@@ -71,6 +71,8 @@ static void _smart_calculate(Evas_Object *obj);
 static void _smart_init(void);
 static inline Eina_Bool _elm_widget_is(const Evas_Object *obj);
 
+static void _if_focused_revert(Evas_Object *obj);
+
 /* local subsystem globals */
 static Evas_Smart *_e_smart = NULL;
 
@@ -1128,6 +1130,30 @@ _newest_focus_order_get(Evas_Object *obj, unsigned int *newest_focus_order)
    return best;
 }
 
+static void
+_if_focused_revert(Evas_Object *obj)
+{
+   Evas_Object *top;
+   Evas_Object *newest = NULL;
+   unsigned int newest_focus_order = 0;
+   
+   INTERNAL_ENTRY;
+   
+   if (!sd->focused) return;
+   if (!sd->parent_obj) return;
+
+   top = elm_widget_top_get(sd->parent_obj);
+   if (top)
+     {
+        newest = _newest_focus_order_get(top, &newest_focus_order);
+        if (newest)
+          {
+             elm_object_unfocus(newest);
+             elm_object_focus(newest);
+          }
+     }
+}
+
 static void
 _smart_del(Evas_Object *obj)
 {
@@ -1161,25 +1187,7 @@ _smart_del(Evas_Object *obj)
    if (sd->style) eina_stringshare_del(sd->style);
    if (sd->type) eina_stringshare_del(sd->type);
    if (sd->theme) elm_theme_free(sd->theme);
-   if (sd->focused)
-     {
-        if (sd->parent_obj)
-          {
-             Evas_Object *top = elm_widget_top_get(sd->parent_obj);
-             Evas_Object *newest = NULL;
-             unsigned int newest_focus_order = 0;
-             
-             if (top)
-               {
-                  newest = _newest_focus_order_get(top, &newest_focus_order);
-                  if (newest)
-                    {
-                       elm_object_unfocus(newest);
-                       elm_object_focus(newest);
-                    }
-               }
-          }
-     }
+   _if_focused_revert(obj);
    free(sd);
 }
 
@@ -1213,6 +1221,7 @@ _smart_hide(Evas_Object *obj)
 {
    INTERNAL_ENTRY;
    evas_object_hide(sd->resize_obj);
+   _if_focused_revert(obj);
 }
 
 static void