summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-11-10 18:51:56 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-11-10 19:06:57 +0900
commit3195b760eec9ea67c988366d3230d8209bb49183 (patch)
tree9c5329c6093b5809aa91e264569529cb3786211c
parent551657e02a1165c3940a98c10f5d2019d1c6a5fe (diff)
ibar - fix shutdown if ibar client menu is up
valgrind pointed out a referencing issue with the ibar client menu on hover and if e is shut down while this is up. it ends up referencing an already deleted ibar icon, so delete the menu objects that reference the icon if icon is deleted. @fix
-rw-r--r--src/modules/ibar/e_mod_main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c
index 437f8ae3b..4980fe37e 100644
--- a/src/modules/ibar/e_mod_main.c
+++ b/src/modules/ibar/e_mod_main.c
@@ -69,6 +69,7 @@ struct _IBar_Icon
69 IBar *ibar; 69 IBar *ibar;
70 Evas_Object *o_holder, *o_icon; 70 Evas_Object *o_holder, *o_icon;
71 Evas_Object *o_holder2, *o_icon2; 71 Evas_Object *o_holder2, *o_icon2;
72 Eina_List *client_objs;
72 Efreet_Desktop *app; 73 Efreet_Desktop *app;
73 Ecore_Timer *reset_timer; 74 Ecore_Timer *reset_timer;
74 Ecore_Timer *timer; 75 Ecore_Timer *timer;
@@ -875,7 +876,9 @@ static void
875_ibar_icon_free(IBar_Icon *ic) 876_ibar_icon_free(IBar_Icon *ic)
876{ 877{
877 E_Exec_Instance *inst; 878 E_Exec_Instance *inst;
879 Evas_Object *o;
878 880
881 EINA_LIST_FREE(ic->client_objs, o) evas_object_del(o);
879 if (ic->ibar->menu_icon == ic) ic->ibar->menu_icon = NULL; 882 if (ic->ibar->menu_icon == ic) ic->ibar->menu_icon = NULL;
880 if (ic->ibar->ic_drop_before == ic) ic->ibar->ic_drop_before = NULL; 883 if (ic->ibar->ic_drop_before == ic) ic->ibar->ic_drop_before = NULL;
881 if (ic->menu) e_object_data_set(E_OBJECT(ic->menu), NULL); 884 if (ic->menu) e_object_data_set(E_OBJECT(ic->menu), NULL);
@@ -1214,9 +1217,11 @@ _ibar_cb_icon_menu_img_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, vo
1214{ 1217{
1215 int w, h; 1218 int w, h;
1216 E_Client *ec; 1219 E_Client *ec;
1217 IBar_Icon *ic = evas_object_data_del(data, "ibar_icon"); 1220 IBar_Icon *ic;
1218 1221
1222 ic = evas_object_data_del(data, "ibar_icon");
1219 if (!ic) return; //menu is closing 1223 if (!ic) return; //menu is closing
1224 if (ic) ic->client_objs = eina_list_remove(ic->client_objs, obj);
1220 if (!ic->menu) return; //who knows 1225 if (!ic->menu) return; //who knows
1221 edje_object_part_box_remove(ic->menu->o_bg, "e.box", data); 1226 edje_object_part_box_remove(ic->menu->o_bg, "e.box", data);
1222 ec = evas_object_data_get(obj, "E_Client"); 1227 ec = evas_object_data_get(obj, "E_Client");
@@ -1279,6 +1284,8 @@ _ibar_icon_menu_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA
1279static void 1284static void
1280_ibar_cb_icon_frame_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) 1285_ibar_cb_icon_frame_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
1281{ 1286{
1287 IBar_Icon *ic = evas_object_data_del(obj, "ibar_icon");
1288 if (ic) ic->client_objs = eina_list_remove(ic->client_objs, obj);
1282 e_comp_object_signal_callback_del_full(data, "e,state,*focused", "e", _ibar_cb_icon_menu_focus_change, obj); 1289 e_comp_object_signal_callback_del_full(data, "e,state,*focused", "e", _ibar_cb_icon_menu_focus_change, obj);
1283 evas_object_smart_callback_del_full(data, "desk_change", _ibar_cb_icon_menu_desk_change, obj); 1290 evas_object_smart_callback_del_full(data, "desk_change", _ibar_cb_icon_menu_desk_change, obj);
1284} 1291}
@@ -1293,10 +1300,12 @@ _ibar_icon_menu_client_add(IBar_Icon *ic, E_Client *ec)
1293 if (ec->netwm.state.skip_taskbar) return EINA_FALSE; 1300 if (ec->netwm.state.skip_taskbar) return EINA_FALSE;
1294 o = ic->menu->o_bg; 1301 o = ic->menu->o_bg;
1295 it = edje_object_add(e_comp->evas); 1302 it = edje_object_add(e_comp->evas);
1303 ic->client_objs = eina_list_append(ic->client_objs, it);
1296 e_comp_object_util_del_list_append(ic->menu->comp_object, it); 1304 e_comp_object_util_del_list_append(ic->menu->comp_object, it);
1297 e_theme_edje_object_set(it, "base/theme/modules/ibar", 1305 e_theme_edje_object_set(it, "base/theme/modules/ibar",
1298 "e/modules/ibar/menu/item"); 1306 "e/modules/ibar/menu/item");
1299 img = e_comp_object_util_mirror_add(ec->frame); 1307 img = e_comp_object_util_mirror_add(ec->frame);
1308 ic->client_objs = eina_list_append(ic->client_objs, img);
1300 e_comp_object_signal_callback_add(ec->frame, "e,state,*focused", "e", _ibar_cb_icon_menu_focus_change, it); 1309 e_comp_object_signal_callback_add(ec->frame, "e,state,*focused", "e", _ibar_cb_icon_menu_focus_change, it);
1301 evas_object_smart_callback_add(ec->frame, "desk_change", _ibar_cb_icon_menu_desk_change, it); 1310 evas_object_smart_callback_add(ec->frame, "desk_change", _ibar_cb_icon_menu_desk_change, it);
1302 evas_object_event_callback_add(it, EVAS_CALLBACK_DEL, 1311 evas_object_event_callback_add(it, EVAS_CALLBACK_DEL,