Enlightenment CVS committal
Author : dj2
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src/lib
Modified Files:
ewl_container.c ewl_widget.c
Log Message:
- fixup reparenting
- set into the new children list _after_ removing from the previous parent
- set the w->parent to the new container _after_ calling remove on the
previous parent. the child_remove from the previous parent will try to set
the parent to NULL, which was whiping out our parent
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_container.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- ewl_container.c 10 Aug 2006 08:21:22 -0000 1.46
+++ ewl_container.c 21 Aug 2006 01:34:15 -0000 1.47
@@ -195,8 +195,8 @@
while (pc->redirect)
pc = pc->redirect;
- ecore_dlist_append(pc->children, child);
ewl_widget_parent_set(child, EWL_WIDGET(pc));
+ ecore_dlist_append(pc->children, child);
ewl_container_child_add_call(pc, child);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -230,8 +230,8 @@
while (pc->redirect)
pc = pc->redirect;
- ecore_dlist_prepend(pc->children, child);
ewl_widget_parent_set(child, EWL_WIDGET(pc));
+ ecore_dlist_prepend(pc->children, child);
ewl_container_child_add_call(pc, child);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -279,8 +279,8 @@
ecore_dlist_next(pc->children);
}
- ecore_dlist_insert(pc->children, child);
ewl_widget_parent_set(child, EWL_WIDGET(pc));
+ ecore_dlist_insert(pc->children, child);
ewl_container_child_add_call(pc, child);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -380,9 +380,8 @@
/*
* If the child isn't found, then this isn't it's parent.
*/
- if (!temp) {
+ if (!temp)
DRETURN(DLEVEL_STABLE);
- }
/* get the index of the widget we are removing */
idx = ecore_dlist_index(pc->children);
@@ -393,8 +392,8 @@
ecore_dlist_remove(pc->children);
if (VISIBLE(child) && REALIZED(child))
ewl_container_child_hide_call(pc, child);
- ewl_container_child_remove_call(pc, child, idx);
+ ewl_container_child_remove_call(pc, child, idx);
ewl_widget_configure(EWL_WIDGET(pc));
DLEAVE_FUNCTION(DLEVEL_STABLE);
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_widget.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -3 -r1.95 -r1.96
--- ewl_widget.c 20 Aug 2006 21:01:57 -0000 1.95
+++ ewl_widget.c 21 Aug 2006 01:34:15 -0000 1.96
@@ -756,12 +756,11 @@
if (op == EWL_CONTAINER(p))
DRETURN(DLEVEL_STABLE);
- if (!p)
- ewl_widget_obscure(w);
+ /* if no parent, obsure the widget */
+ if (!p) ewl_widget_obscure(w);
emb = ewl_embed_widget_find(w);
- if (emb)
- ewl_embed_info_widgets_cleanup(emb, w);
+ if (emb) ewl_embed_info_widgets_cleanup(emb, w);
/*
* Verify this will not result in recursively nested widgets.
@@ -775,18 +774,20 @@
tmp = tmp->parent;
}
- /*
- * Set this to the new parent here to avoid infinite recursion when
- * called from ewl_container_child_remove.
- */
- w->parent = p;
+ /* set the parent to NULL before doing the child remove */
+ w->parent = NULL;
/*
* A widget cannot be the child of multiple widgets, so remove it
* from a previous parent before adding to this parent.
*/
- if (op)
- ewl_container_child_remove(op, w);
+ if (op) ewl_container_child_remove(op, w);
+
+ /*
+ * Set this to the new parent here to avoid infinite recursion when
+ * called from ewl_container_child_remove.
+ */
+ w->parent = p;
ewl_callback_call_with_event_data(w, EWL_CALLBACK_REPARENT, p);
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs