forked from enlightenment/efl
elm_win: handle icon object lifetimes more accurately, use icon_name in csd icon
in the case where an icon existed upon having an icon object set, the previous icon object would be orphaned while still being visible. the new icon would then never be set into the csd. @fix
This commit is contained in:
parent
53f0b89671
commit
6a1c466136
|
@ -3102,12 +3102,19 @@ _elm_win_frame_add(Elm_Win_Data *sd, const char *style)
|
||||||
|
|
||||||
evas_object_is_frame_object_set(sd->frame_obj, EINA_TRUE);
|
evas_object_is_frame_object_set(sd->frame_obj, EINA_TRUE);
|
||||||
|
|
||||||
if (!sd->icon)
|
if (sd->icon)
|
||||||
|
evas_object_show(sd->icon);
|
||||||
|
else
|
||||||
{
|
{
|
||||||
Efreet_Desktop *d;
|
Eina_Bool set = EINA_FALSE;
|
||||||
|
|
||||||
sd->icon = elm_icon_add(sd->obj);
|
sd->icon = elm_icon_add(sd->obj);
|
||||||
|
|
||||||
|
if (sd->icon_name)
|
||||||
|
set = elm_icon_standard_set(sd->icon, sd->icon_name);
|
||||||
|
if ((!sd->icon_name) || (!set))
|
||||||
|
{
|
||||||
|
Efreet_Desktop *d;
|
||||||
d = efreet_util_desktop_exec_find(_elm_appname);
|
d = efreet_util_desktop_exec_find(_elm_appname);
|
||||||
if (d)
|
if (d)
|
||||||
{
|
{
|
||||||
|
@ -3115,6 +3122,7 @@ _elm_win_frame_add(Elm_Win_Data *sd, const char *style)
|
||||||
efreet_desktop_free(d);
|
efreet_desktop_free(d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
edje_object_part_swallow(sd->frame_obj, "elm.swallow.icon",
|
edje_object_part_swallow(sd->frame_obj, "elm.swallow.icon",
|
||||||
sd->icon);
|
sd->icon);
|
||||||
|
@ -3210,6 +3218,7 @@ _elm_win_frame_del(Elm_Win_Data *sd)
|
||||||
|
|
||||||
ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
|
ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
|
||||||
}
|
}
|
||||||
|
if (sd->icon) evas_object_hide(sd->icon);
|
||||||
|
|
||||||
evas_output_framespace_set(sd->evas, 0, 0, 0, 0);
|
evas_output_framespace_set(sd->evas, 0, 0, 0, 0);
|
||||||
ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
|
ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
|
||||||
|
@ -4205,12 +4214,17 @@ EOLIAN static void
|
||||||
_elm_win_icon_object_set(Eo *obj, Elm_Win_Data *sd, Evas_Object *icon)
|
_elm_win_icon_object_set(Eo *obj, Elm_Win_Data *sd, Evas_Object *icon)
|
||||||
{
|
{
|
||||||
if (sd->icon)
|
if (sd->icon)
|
||||||
evas_object_event_callback_del_full
|
evas_object_event_callback_del_full(sd->icon, EVAS_CALLBACK_DEL,
|
||||||
(sd->icon, EVAS_CALLBACK_DEL, _elm_win_on_icon_del, obj);
|
_elm_win_on_icon_del, obj);
|
||||||
|
evas_object_del(sd->icon);
|
||||||
sd->icon = icon;
|
sd->icon = icon;
|
||||||
if (sd->icon)
|
if (sd->icon)
|
||||||
evas_object_event_callback_add
|
{
|
||||||
(sd->icon, EVAS_CALLBACK_DEL, _elm_win_on_icon_del, obj);
|
evas_object_event_callback_add(sd->icon, EVAS_CALLBACK_DEL,
|
||||||
|
_elm_win_on_icon_del, obj);
|
||||||
|
if (sd->frame_obj)
|
||||||
|
edje_object_part_swallow(sd->frame_obj, "elm.swallow.icon", sd->icon);
|
||||||
|
}
|
||||||
#ifdef HAVE_ELEMENTARY_X
|
#ifdef HAVE_ELEMENTARY_X
|
||||||
_elm_win_xwin_update(sd);
|
_elm_win_xwin_update(sd);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue