Hi All,
        Here's a patch to ibox that fixes BUG 4 in the E TODO:

* BUG: if iconified window quits qhile iconified and ibox is being used then e segv's

Basically, I added a handler for remove events to monitor when an app is removed, then remove it from ibox. Tested well, and stops the E segv.

Cheers,
devilhorns
--- e_mod_main.c.orig	2005-12-12 14:16:03.000000000 -0500
+++ e_mod_main.c	2005-12-12 14:22:29.000000000 -0500
@@ -67,6 +67,7 @@
 
 static int     _ibox_box_cb_event_border_iconify(void *data, int type, void *event);
 static int     _ibox_box_cb_event_border_uniconify(void *data, int type, void *event);
+static int     _ibox_box_cb_event_border_remove(void *data, int type, void *event);
 
 static void    _ibox_icon_cb_intercept_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y);
 static void    _ibox_icon_cb_intercept_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h);
@@ -335,6 +336,8 @@
       ecore_event_handler_add(E_EVENT_BORDER_ICONIFY, _ibox_box_cb_event_border_iconify, ibb);
    ibb->ev_handler_border_uniconify = 
       ecore_event_handler_add(E_EVENT_BORDER_UNICONIFY, _ibox_box_cb_event_border_uniconify, ibb);
+   ibb->ev_handler_border_remove = 
+      ecore_event_handler_add(E_EVENT_BORDER_REMOVE, _ibox_box_cb_event_border_remove, ibb);
  
    bl = e_container_border_list_first(ibb->con);
    while ((bd = e_container_border_list_next(bl)))
@@ -411,6 +414,8 @@
 
    ecore_event_handler_del(ibb->ev_handler_border_iconify);
    ecore_event_handler_del(ibb->ev_handler_border_uniconify);
+   ecore_event_handler_del(ibb->ev_handler_border_remove);
+   
    while (ibb->icons)
      _ibox_icon_free(ibb->icons->data);
 
@@ -1201,6 +1206,24 @@
    return 1;
 }
 
+static int
+_ibox_box_cb_event_border_remove(void *data, int type, void *event)
+{
+   E_Event_Border_Remove *ev;
+   IBox_Box *ibb;
+   IBox_Icon *ic;
+
+   ev = event;
+   ibb = data;
+
+   ic = _ibox_icon_find(ibb, ev->border);
+   if (ic)
+     _ibox_icon_free(ic);
+   _ibox_box_frame_resize(ibb);
+
+   return 1;
+}
+
 static void
 _ibox_box_cb_gmc_change(void *data, E_Gadman_Client *gmc, E_Gadman_Change change)
 {
--- e_mod_main.h.orig	2005-12-12 14:17:24.000000000 -0500
+++ e_mod_main.h	2005-12-12 14:17:40.000000000 -0500
@@ -54,6 +54,7 @@
 
    Ecore_Event_Handler *ev_handler_border_iconify;
    Ecore_Event_Handler *ev_handler_border_uniconify;
+   Ecore_Event_Handler *ev_handler_border_remove;
    
    double          align, align_req;
    double          follow, follow_req;

Reply via email to