Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_imenu.c ewl_imenu.h ewl_menu.c ewl_menu.h 


Log Message:
- if the menu's popup is destroyed make sure we set the menu->base.popup to 
NULL so that the menu_base code dosen't try to destroy the popup in it's 
DESTROY callback

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_imenu.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ewl_imenu.c 2 Dec 2005 20:09:57 -0000       1.7
+++ ewl_imenu.c 17 Dec 2005 21:40:53 -0000      1.8
@@ -64,6 +64,8 @@
                                   EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(menu->base.popup),
                                 EWL_FLAG_ALIGN_LEFT | EWL_FLAG_ALIGN_TOP);
+       ewl_callback_prepend(menu->base.popup, EWL_CALLBACK_DESTROY,
+                               ewl_imenu_popup_destroy_cb, menu);
 
        DRETURN_INT(TRUE, DLEVEL_STABLE);
 }
@@ -116,3 +118,18 @@
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
+void
+ewl_imenu_popup_destroy_cb(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
+                               void *data)
+{
+       Ewl_Imenu *menu;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("data", data);
+
+       menu = data;
+       if (menu->base.popup) menu->base.popup = NULL;
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_imenu.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ewl_imenu.h 24 Oct 2005 00:54:07 -0000      1.4
+++ ewl_imenu.h 17 Dec 2005 21:40:53 -0000      1.5
@@ -44,6 +44,7 @@
  */
 void ewl_imenu_configure_cb(Ewl_Widget *w, void *ev_data, void *user_data);
 void ewl_imenu_expand_cb(Ewl_Widget *w, void *ev_data, void *user_data);
+void ewl_imenu_popup_destroy_cb(Ewl_Widget *w, void *ev, void *data);
 
 /**
  * @}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_menu.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- ewl_menu.c  2 Dec 2005 20:09:57 -0000       1.18
+++ ewl_menu.c  17 Dec 2005 21:40:53 -0000      1.19
@@ -74,6 +74,8 @@
                                 EWL_FLAG_ALIGN_LEFT | EWL_FLAG_ALIGN_TOP);
        ewl_callback_append(menu->base.popup, EWL_CALLBACK_MOUSE_DOWN,
                            ewl_menu_hide_cb, NULL);
+       ewl_callback_prepend(menu->base.popup, EWL_CALLBACK_DESTROY,
+                               ewl_menu_popup_destroy_cb, menu);
 
        DRETURN_INT(TRUE, DLEVEL_STABLE);
 }
@@ -188,3 +190,19 @@
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
+
+void
+ewl_menu_popup_destroy_cb(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
+                                       void *data)
+{
+       Ewl_Menu *m;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("data", data);
+
+       m = data;
+       if (m->base.popup) m->base.popup = NULL;
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_menu.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- ewl_menu.h  26 Oct 2005 03:46:13 -0000      1.6
+++ ewl_menu.h  17 Dec 2005 21:40:53 -0000      1.7
@@ -49,6 +49,7 @@
 void ewl_menu_expand_cb(Ewl_Widget *w, void *ev_data, void *user_data);
 void ewl_menu_popup_move_cb(Ewl_Widget *w, void *ev_data, void *user_data);
 void ewl_menu_hide_cb(Ewl_Widget *w, void *ev_data, void *user_data);
+void ewl_menu_popup_destroy_cb(Ewl_Widget *w, void *ev, void *data);
 
 /**
  * @}




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to