Revision: 3187
          http://vexi.svn.sourceforge.net/vexi/?rev=3187&view=rev
Author:   clrg
Date:     2008-11-09 23:38:15 +0000 (Sun, 09 Nov 2008)

Log Message:
-----------
Move tryPropagateMove from reflow to post-render - so it is only invoked once 
the screen is updated - as it was slowing down Vexi when redundantly called in 
reflow()

Modified Paths:
--------------
    trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp
    trunk/core/org.vexi.core/src/org/vexi/core/Surface.java

Modified: trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp  2008-11-09 20:57:43 UTC 
(rev 3186)
+++ trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp  2008-11-09 23:38:15 UTC 
(rev 3187)
@@ -377,22 +377,13 @@
     }
 
     /** should only be invoked on the root box */
-    public void reflow(int w, int h) {
-        if ((flags & REFLOW) == 0 && w==width && h==height) return;
+    public boolean reflow(int w, int h) {
+        if ((flags & REFLOW) == 0 && w==width && h==height) return false;
         constrain();
         tryResize(w, h);
-        boolean mouseUpdateRequired = test(PLACE)||test(PLACE_DESCENDENT);
+        boolean mouseUpdateRequired = test(PLACE|PLACE_DESCENDENT);
         place();
-        if (mouseUpdateRequired) {
-            // the boxes under the mouse may have changed
-            Surface s = getSurface();
-            try {
-                tryPropagateMove(s.mousex, s.mousey);
-            } catch (JSExn e) {
-                Log.uWarn(Box.class,"Caught JS Exception while invoking 
tryPropagateMove");
-                Log.uWarn(Box.class,e);
-            }
-        }
+        return mouseUpdateRequired;
     }
 
     /** constrain box children then establish the minimum size of a box */

Modified: trunk/core/org.vexi.core/src/org/vexi/core/Surface.java
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/core/Surface.java     2008-11-09 
20:57:43 UTC (rev 3186)
+++ trunk/core/org.vexi.core/src/org/vexi/core/Surface.java     2008-11-09 
23:38:15 UTC (rev 3187)
@@ -402,6 +402,8 @@
         scheduled = false;
         // do nothing if we are minimized
         if (minimized) return;
+        // reflow requests refresh of cursor
+        boolean mouseUpdateRequired = false;
         // make sure the root is properly sized
         do {
             abort = false;
@@ -417,7 +419,7 @@
             // reflow to new size as set by the frame
             int cwidth = root.contentwidth;
             int cheight = root.contentheight;
-            root.reflow(pendingWidth, pendingHeight);
+            mouseUpdateRequired = root.reflow(pendingWidth, pendingHeight) || 
mouseUpdateRequired;
             if (cwidth!=root.contentwidth || cheight!=root.contentheight)
                 setMinimumSize(root.contentwidth, root.contentheight);
         } while(abort);
@@ -451,6 +453,17 @@
                 return;
             }
         }
+        
+        // it is possible that the box[es] under the mouse may have changed
+        // so we must re-invoke Move update trigger Enter/Leave/mouseinside
+        if (mouseUpdateRequired) {
+            try {
+                root.tryPropagateMove(mousex, mousey);
+            } catch (JSExn e) {
+                Log.uWarn(Box.class,"Caught JS Exception while invoking 
tryPropagateMove");
+                Log.uWarn(Box.class,e);
+            }
+        }
     }
 
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to