diff --git a/src/servers/app/ViewLayer.cpp b/src/servers/app/ViewLayer.cpp index 17594d00b3..d13c72c817 100644 --- a/src/servers/app/ViewLayer.cpp +++ b/src/servers/app/ViewLayer.cpp @@ -515,6 +515,28 @@ ViewLayer::_UpdateOverlayView() const } +/*! + This method is called whenever the window is resized or moved - would + be nice to have a better solution for this, though. +*/ +void +ViewLayer::UpdateOverlay() +{ + if (!IsVisible()) + return; + + if (_Overlay() != NULL) { + _UpdateOverlayView(); + } else { + // recursively ask children of this view + + for (ViewLayer* child = FirstChild(); child; child = child->NextSibling()) { + child->UpdateOverlay(); + } + } +} + + void ViewLayer::ConvertToParent(BPoint* point) const { @@ -756,9 +778,6 @@ ViewLayer::MoveBy(int32 x, int32 y, BRegion* dirtyRegion) // the screen clipping InvalidateScreenClipping(true); } - - // overlay handling - _UpdateOverlayView(); } // ResizeBy @@ -822,9 +841,6 @@ ViewLayer::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion) // TODO: when the implementation of Hide() and Show() is // complete, see if this should be avoided RebuildClipping(false); - - // overlay handling - _UpdateOverlayView(); } // ParentResized diff --git a/src/servers/app/ViewLayer.h b/src/servers/app/ViewLayer.h index 3e3a7080c6..daf99403fe 100644 --- a/src/servers/app/ViewLayer.h +++ b/src/servers/app/ViewLayer.h @@ -183,6 +183,8 @@ class ViewLayer { // according to the parents visibility void UpdateVisibleDeep(bool parentVisible); + void UpdateOverlay(); + void MarkBackgroundDirty(); bool IsBackgroundDirty() const { return fBackgroundDirty; } diff --git a/src/servers/app/WindowLayer.cpp b/src/servers/app/WindowLayer.cpp index a828387fff..f1dcfeba28 100644 --- a/src/servers/app/WindowLayer.cpp +++ b/src/servers/app/WindowLayer.cpp @@ -316,8 +316,10 @@ WindowLayer::MoveBy(int32 x, int32 y) if (fDecorator) fDecorator->MoveBy(x, y); - if (fTopLayer != NULL) + if (fTopLayer != NULL) { fTopLayer->MoveBy(x, y, NULL); + fTopLayer->UpdateOverlay(); + } // the desktop will take care of dirty regions @@ -373,8 +375,10 @@ WindowLayer::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion) //} } - if (fTopLayer != NULL) + if (fTopLayer != NULL) { fTopLayer->ResizeBy(x, y, dirtyRegion); + fTopLayer->UpdateOverlay(); + } //if (dirtyRegion) //fDrawingEngine->FillRegion(*dirtyRegion, RGBColor(0, 255, 255, 255));