From 3be866c1a76e546cbb5a2a4a26f3c8d978a8081e Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 20 Mar 2012 14:10:42 +0200 Subject: [PATCH] #8515 Avoid painting invisible children, also through old style paint calls --- src/com/vaadin/ui/AbstractComponent.java | 4 ++++ src/com/vaadin/ui/DirtyConnectorTracker.java | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/com/vaadin/ui/AbstractComponent.java b/src/com/vaadin/ui/AbstractComponent.java index e440bc57c5..4d12e0ed27 100644 --- a/src/com/vaadin/ui/AbstractComponent.java +++ b/src/com/vaadin/ui/AbstractComponent.java @@ -737,6 +737,10 @@ public abstract class AbstractComponent implements Component, MethodEventSource * if the paint operation failed. */ public void paint(PaintTarget target) throws PaintException { + if (!isVisibleInContext()) { + return; + } + final String tag = target.getTag(this); final PaintStatus status = target.startPaintable(this, tag); if (PaintStatus.DEFER == status) { diff --git a/src/com/vaadin/ui/DirtyConnectorTracker.java b/src/com/vaadin/ui/DirtyConnectorTracker.java index 1225b5f84f..a3bdd8a3a9 100644 --- a/src/com/vaadin/ui/DirtyConnectorTracker.java +++ b/src/com/vaadin/ui/DirtyConnectorTracker.java @@ -100,7 +100,17 @@ public class DirtyConnectorTracker implements RepaintRequestListener { System.out.println("All components are now clean"); } + /** + * Marks all visible components dirty, starting from the given component and + * going downwards in the hierarchy. + * + * @param c + * The component to start iterating downwards from + */ private void markComponentsDirtyRecursively(Component c) { + if (!c.isVisible()) { + return; + } markDirty(c); if (c instanceof HasComponents) { HasComponents container = (HasComponents) c; -- 2.39.5