aboutsummaryrefslogtreecommitdiff
path: root/libjava/javax/swing/RepaintManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/javax/swing/RepaintManager.java')
-rw-r--r--libjava/javax/swing/RepaintManager.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/libjava/javax/swing/RepaintManager.java b/libjava/javax/swing/RepaintManager.java
index 30b6e19..05b974f 100644
--- a/libjava/javax/swing/RepaintManager.java
+++ b/libjava/javax/swing/RepaintManager.java
@@ -252,16 +252,22 @@ public class RepaintManager
*/
public synchronized void addInvalidComponent(JComponent component)
{
- while ((component.getParent() != null)
- && (component.getParent() instanceof JComponent)
- && (component.isValidateRoot()))
- component = (JComponent) component.getParent();
+ Component ancestor = component.getParent();
+
+ while (ancestor != null
+ && (! (ancestor instanceof JComponent)
+ || ! ((JComponent) ancestor).isValidateRoot() ))
+ ancestor = ancestor.getParent();
+
+ if (ancestor != null
+ && ancestor instanceof JComponent
+ && ((JComponent) ancestor).isValidateRoot())
+ component = (JComponent) ancestor;
if (invalidComponents.contains(component))
return;
invalidComponents.add(component);
- component.invalidate();
if (! repaintWorker.isLive())
{