Enlightenment CVS committal

Author  : pfritz
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_paned.c 


Log Message:
fix infinite loop

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_paned.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -3 -r1.42 -r1.43
--- ewl_paned.c 19 Jan 2007 21:13:05 -0000      1.42
+++ ewl_paned.c 20 Jan 2007 00:01:13 -0000      1.43
@@ -422,6 +422,11 @@
                        layout->stable_request(EWL_OBJECT(child), other_size);
                }
        }
+       /* we need to now the number of panes = the number of children
+        * divided by two, because we don't count the grabber and 
+        * minus one because we cannot change the size of the 
+        * last pane directly*/ 
+       pane_num = ecore_list_nodes(c->children)/2 - 1;
        /* We now resize the pane areas so that they fit into the new size
         * therefor we have to first calculate, how many space is available
         * for giving or taking it from the panes */
@@ -432,17 +437,15 @@
                int old_pos, give;
 
                cur_pos = old_pos = main_dir;
-               /* we need to now the number of panes = the number of children
-                * divided by two, because we don't count the grabber and 
-                * minus one because we cannot change the size of the 
-                * last pane directly*/ 
-               pane_num = ecore_list_nodes(c->children)/2 - 1;
                /* if we have no panes we don't need to calc their place */
                if (pane_num < 1)
                        break;  
 
                /* give can also be negative, so see it as a can take or give */
                give = available / pane_num;
+               /* reset the pane_num now 
+                * FIXME: we should actually only count the visible ones*/
+               pane_num = ecore_list_nodes(c->children)/2 - 1;
                /* to prevent rounding errors */
                if (give == 0) {
                        give = (available > 0) ? 1 : -1;



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to