From b4417cc3304005f4b16569dc3c331e53bd08e0af Mon Sep 17 00:00:00 2001 From: Charlie Groves Date: Wed, 3 Oct 2007 22:10:28 +0000 Subject: [PATCH] Add a switch to disable dirtying the whole screen on an invalid component on the Mac again. I can't reproduce the problem now, and I might have just been seeing some sea monster badness before. Leave the current behavior on by default though. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@298 ed5b42cb-e716-0410-a449-f6a68f950b19 --- .../com/threerings/media/ActiveRepaintManager.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/media/ActiveRepaintManager.java b/src/java/com/threerings/media/ActiveRepaintManager.java index 086c4460..54728d00 100644 --- a/src/java/com/threerings/media/ActiveRepaintManager.java +++ b/src/java/com/threerings/media/ActiveRepaintManager.java @@ -42,6 +42,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map.Entry; +import com.samskivert.swing.RuntimeAdjust; import com.samskivert.util.ListUtil; import com.samskivert.util.RunAnywhere; import com.samskivert.util.StringUtil; @@ -124,7 +125,7 @@ public class ActiveRepaintManager extends RepaintManager // on the mac, components frequently do not repaint themselves after being invalidated // so we have to force a repaint from the validation roon on down - if (RunAnywhere.isMacOS() && vroot instanceof JComponent) { + if (RunAnywhere.isMacOS() && _macDirtyOnInvalid && vroot instanceof JComponent) { addDirtyRegion((JComponent)vroot, 0, 0, vroot.getWidth(), vroot.getHeight()); } } @@ -440,6 +441,13 @@ public class ActiveRepaintManager extends RepaintManager comp = comp.getParent(); } } + + /** + * Set if the Mac should dirty its validation root if a single component is invalid. + */ + public static void setMacDirtyOnInvalid(boolean dirty) { + _macDirtyOnInvalid = dirty; + } /** The root of our interface. */ protected Component _root; @@ -461,4 +469,8 @@ public class ActiveRepaintManager extends RepaintManager /** We debug so much that we have to make it easy to enable and disable debug logging. Yay! */ protected static final boolean DEBUG = false; + + /** If true, Macs dirty the whole screen if any component is invalid */ + protected static boolean _macDirtyOnInvalid = true; + }