X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FSurface.java;h=fd665541f3e82b6757df9e752848d049d3c05a71;hb=fa49b56b41be191e83bcf8222381fee2c4e0355b;hp=eca0dee05bd586cef2d6b24a56b7ca9379147e60;hpb=97daadb9ac5a453889da76c8c4c72f8f6badcba2;p=org.ibex.core.git diff --git a/src/org/xwt/Surface.java b/src/org/xwt/Surface.java index eca0dee..fd66554 100644 --- a/src/org/xwt/Surface.java +++ b/src/org/xwt/Surface.java @@ -29,7 +29,9 @@ public abstract class Surface extends PixelBuffer implements Scheduler.Task { public static Vec allSurfaces = new Vec(); /** When set to true, render() should abort as soon as possible and restart the rendering process */ - static volatile boolean abort = false; + volatile boolean abort = false; + volatile int pendingWidth = -1; + volatile int pendingHeight = -1; public static boolean alt = false; ///< true iff the alt button is pressed down, in real time public static boolean control = false; ///< true iff the control button is pressed down, in real time @@ -140,8 +142,8 @@ public abstract class Surface extends PixelBuffer implements Scheduler.Task { try { root.putAndTriggerTraps("_Move", T); } catch (JSExn e) { - Log.log(Surface.class, "Exception thrown from Move message handler"); - Log.logJS(e); + Log.info(Surface.class, "Exception thrown from Move message handler"); + JS.log(e); } if (!cursor.equals(oldcursor)) syncCursor(); } @@ -158,22 +160,11 @@ public abstract class Surface extends PixelBuffer implements Scheduler.Task { Scheduler.add(this); } - private Scheduler.Task nextSizeChange = null; - // FEATURE: can we avoid creating objects here? /** subclasses should invoke this method when the user resizes the window */ protected final void SizeChange(final int width, final int height) { - if (root.maxwidth == width && root.maxheight == height) return; - nextSizeChange = new Scheduler.Task() { public void perform() { - if (nextSizeChange != this) return; - // dirty the place where the scar used to be - root.dirty(0, root.maxheight - Main.scarImage.height, Main.scarImage.width, Main.scarImage.height); - root.setMaxWidth(JS.N(width)); - root.setMaxHeight(JS.N(height)); - nextSizeChange = null; - Refresh(); - }}; - Scheduler.addAtFront(nextSizeChange); - abort = true; + pendingWidth = width; + pendingHeight = height; + Refresh(); } // FEATURE: can we avoid creating objects here? @@ -193,19 +184,7 @@ public abstract class Surface extends PixelBuffer implements Scheduler.Task { protected final void Minimized(boolean b) { minimized = b; new SimpleMessage("Minimized", b ? T : F, root); } protected final void Maximized(boolean b) { maximized = b; new SimpleMessage("Maximized", b ? T : F, root); } protected final void Focused(boolean b) { new SimpleMessage("Focused", b ? T : F, root); } - public static void Refresh() { needRender = true; Scheduler.add(new Scheduler.Task() { public void perform() { } }); } - - public static boolean needRender = false; - public static final Scheduler.Task renderAll = new Scheduler.Task() { - public void perform() { - for(int i=0; i