Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src


Modified Files:
        ewl_tree.c ewl_widget.c 


Log Message:
A little tree work, not fixed, but at least doesn't lock the test program.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_tree.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- ewl_tree.c  29 Sep 2003 21:46:51 -0000      1.20
+++ ewl_tree.c  20 Oct 2003 18:09:43 -0000      1.21
@@ -477,7 +477,8 @@
        DENTER_FUNCTION(DLEVEL_STABLE);
 
        t = EWL_TREE(c);
-       ewl_container_append_child(EWL_CONTAINER(t->scrollarea), w);
+       if (w != t->scrollarea)
+               ewl_container_append_child(EWL_CONTAINER(t->scrollarea), w);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_widget.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -3 -r1.78 -r1.79
--- ewl_widget.c        20 Oct 2003 16:20:00 -0000      1.78
+++ ewl_widget.c        20 Oct 2003 18:09:43 -0000      1.79
@@ -480,6 +480,7 @@
  */
 void ewl_widget_set_parent(Ewl_Widget * w, Ewl_Widget * p)
 {
+       Ewl_Widget *tmp;
        Ewl_Container *op;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
@@ -488,6 +489,18 @@
        op = EWL_CONTAINER(w->parent);
        if (op == EWL_CONTAINER(p))
                DRETURN(DLEVEL_STABLE);
+
+       /*
+        * Verify this will not result in recursively nested widgets.
+        */
+       tmp = p;
+       while (tmp) {
+               if (tmp == w) {
+                       ewl_print_warning();
+                       DRETURN(DLEVEL_STABLE);
+               }
+               tmp = tmp->parent;
+       }
 
        w->parent = p;
 




-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise 
Linux in the Boardroom; in the Front Office; & in the Server Room 
http://www.enterpriselinuxforum.com
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to