From: <enl...@li...> - 2003-09-25 01:43:20
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src Modified Files: ewl_embed.c ewl_enums.h ewl_misc.c ewl_widget.c ewl_window.c Log Message: Some sanity checks for realizing to keep from triggering nasty recursion like effects. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_embed.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ewl_embed.c 22 Sep 2003 06:09:24 -0000 1.4 +++ ewl_embed.c 25 Sep 2003 01:43:18 -0000 1.5 @@ -93,6 +93,7 @@ __ewl_embed_child_add, __ewl_embed_child_resize, NULL); ewl_object_set_fill_policy(EWL_OBJECT(w), EWL_FILL_POLICY_NONE); + EWL_WIDGET(w)->flags |= EWL_FLAGS_TOPLEVEL; ewl_callback_append(EWL_WIDGET(w), EWL_CALLBACK_UNREALIZE, __ewl_embed_unrealize, NULL); @@ -255,6 +256,9 @@ while (w->parent) w = w->parent; + + if (!(w->flags & EWL_FLAGS_TOPLEVEL)) + w = NULL; DRETURN_PTR(EWL_EMBED(w), DLEVEL_STABLE); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_enums.h,v retrieving revision 1.38 retrieving revision 1.39 diff -u -3 -r1.38 -r1.39 --- ewl_enums.h 24 Sep 2003 07:12:25 -0000 1.38 +++ ewl_enums.h 25 Sep 2003 01:43:18 -0000 1.39 @@ -137,9 +137,10 @@ EWL_FLAGS_REALIZED = 0x2, EWL_FLAGS_OBSCURED = 0x4, EWL_FLAGS_RECURSIVE = 0x8, - EWL_FLAGS_CSCHEDULED = 0x10, - EWL_FLAGS_RSCHEDULED = 0x20, - EWL_FLAGS_DSCHEDULED = 0x40, + EWL_FLAGS_TOPLEVEL = 0x10, + EWL_FLAGS_CSCHEDULED = 0x20, + EWL_FLAGS_RSCHEDULED = 0x40, + EWL_FLAGS_DSCHEDULED = 0x80, }; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_misc.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -3 -r1.37 -r1.38 --- ewl_misc.c 24 Sep 2003 07:12:25 -0000 1.37 +++ ewl_misc.c 25 Sep 2003 01:43:18 -0000 1.38 @@ -5,9 +5,10 @@ char *xdisplay = NULL; extern Ewd_List *ewl_embed_list; -static Ewd_List *configure_list = NULL; -static Ewd_List *realize_list = NULL; -static Ewd_List *destroy_list = NULL; + +Ewd_List *configure_list = NULL; +Ewd_List *realize_list = NULL; +Ewd_List *destroy_list = NULL; void __ewl_init_parse_options(int argc, char **argv); void __ewl_parse_option_array(int argc, char **argv); @@ -132,18 +133,18 @@ if (ewd_list_is_empty(ewl_embed_list)) DRETURN_INT(TRUE, DLEVEL_STABLE); + edje_freeze(); + /* * First realize any widgets that require it, this looping should * avoid deep recursion. */ ewd_list_goto_first(realize_list); while ((w = ewd_list_remove_first(realize_list))) { - edje_freeze(); if (VISIBLE(w) && !REALIZED(w)) { w->flags &= ~EWL_FLAGS_RSCHEDULED; ewl_widget_realize(EWL_WIDGET(w)); } - edje_thaw(); } /* @@ -157,6 +158,7 @@ w->flags &= ~EWL_FLAGS_CSCHEDULED; ewl_callback_call(w, EWL_CALLBACK_CONFIGURE); } + edje_thaw(); /* * Allow each embed to render itself. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_widget.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -3 -r1.71 -r1.72 --- ewl_widget.c 24 Sep 2003 07:12:25 -0000 1.71 +++ ewl_widget.c 25 Sep 2003 01:43:18 -0000 1.72 @@ -130,12 +130,15 @@ if (REALIZED(w)) DRETURN(DLEVEL_STABLE); + /* + * The parent's realize function will get us here again. + */ if (w->parent && !REALIZED(w->parent)) ewl_widget_realize(w->parent); - - ewl_callback_call(w, EWL_CALLBACK_REALIZE); - - ewl_widget_show(w); + else if (w->parent || w->flags & EWL_FLAGS_TOPLEVEL) { + ewl_callback_call(w, EWL_CALLBACK_REALIZE); + ewl_widget_show(w); + } DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_window.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -3 -r1.53 -r1.54 --- ewl_window.c 22 Sep 2003 06:09:24 -0000 1.53 +++ ewl_window.c 25 Sep 2003 01:43:18 -0000 1.54 @@ -237,7 +237,8 @@ ecore_x_window_prop_name_class_set(window->window, "EWL", "EWL!"); ecore_x_window_prop_title_set(window->window, window->title); - ecore_x_window_prop_delete_request_set(window->window, 1); + ecore_x_window_prop_protocol_set(window->window, + ECORE_X_WM_PROTOCOL_DELETE_REQUEST,1); embed->evas = evas_new(); evas_output_method_set(embed->evas, |