diff --git a/src/servers/app/DefaultDecorator.cpp b/src/servers/app/DefaultDecorator.cpp index fbe2bffa4f..5128c6312f 100644 --- a/src/servers/app/DefaultDecorator.cpp +++ b/src/servers/app/DefaultDecorator.cpp @@ -474,9 +474,9 @@ DefaultDecorator::GetFootprint(BRegion *region) if (fLook == B_NO_BORDER_WINDOW_LOOK) return; + region->Include(fTopBorder); region->Include(fLeftBorder); region->Include(fRightBorder); - region->Include(fTopBorder); region->Include(fBottomBorder); if (fLook == B_BORDERED_WINDOW_LOOK) diff --git a/src/servers/app/WindowLayer.cpp b/src/servers/app/WindowLayer.cpp index ab7aead44f..2418aca9e7 100644 --- a/src/servers/app/WindowLayer.cpp +++ b/src/servers/app/WindowLayer.cpp @@ -76,15 +76,16 @@ WindowLayer::WindowLayer(const BRect& frame, const char *name, fVisibleRegion(), fVisibleContentRegion(), - fVisibleContentRegionValid(false), fDirtyRegion(), fDirtyCause(0), fBorderRegion(), - fBorderRegionValid(false), fContentRegion(), - fContentRegionValid(false), fEffectiveDrawingRegion(), + + fVisibleContentRegionValid(false), + fBorderRegionValid(false), + fContentRegionValid(false), fEffectiveDrawingRegionValid(false), fRegionPool(), @@ -203,11 +204,9 @@ WindowLayer::GetFullRegion(BRegion* region) // TODO: if someone needs to call this from // the outside, the clipping needs to be readlocked! + // start from the decorator border, extend to use the frame GetBorderRegion(region); - - // start from the frame, extend to include decorator border region->Include(fFrame); - } // GetBorderRegion @@ -218,25 +217,11 @@ WindowLayer::GetBorderRegion(BRegion* region) // the outside, the clipping needs to be readlocked! if (!fBorderRegionValid) { - // TODO: checkup Decorator::GetFootPrint() to see if it is as fast as this: -/* fBorderRegion.Set(BRect(fFrame.left - 4, fFrame.top - 20, - (fFrame.left + fFrame.right) / 2, fFrame.top - 5)); - fBorderRegion.Include(BRect(fFrame.left - 4, fFrame.top - 4, - fFrame.right + 4, fFrame.top - 1)); - fBorderRegion.Include(BRect(fFrame.left - 4, fFrame.top, - fFrame.left - 1, fFrame.bottom)); - fBorderRegion.Include(BRect(fFrame.right + 1, fFrame.top, - fFrame.right + 4, fFrame.bottom - 11)); - fBorderRegion.Include(BRect(fFrame.left - 4, fFrame.bottom + 1, - fFrame.right - 11, fFrame.bottom + 4)); - fBorderRegion.Include(BRect(fFrame.right - 10, fFrame.bottom - 10, - fFrame.right + 4, fFrame.bottom + 4));*/ - - // TODO: remove and use Decorator::GetFootPrint() - // start from the frame, extend to include decorator border - if (fDecorator) { + if (fDecorator) fDecorator->GetFootprint(&fBorderRegion); - } + else + fBorderRegion.MakeEmpty(); + fBorderRegionValid = true; } diff --git a/src/servers/app/WindowLayer.h b/src/servers/app/WindowLayer.h index 683b30cb0f..8f40c2d1eb 100644 --- a/src/servers/app/WindowLayer.h +++ b/src/servers/app/WindowLayer.h @@ -250,7 +250,6 @@ class WindowLayer { BRegion fVisibleRegion; BRegion fVisibleContentRegion; - bool fVisibleContentRegionValid; // our part of the "global" dirty region // it is calculated from the desktop thread, // but we can write to it when we read locked @@ -261,24 +260,26 @@ class WindowLayer { // caching local regions BRegion fBorderRegion; - bool fBorderRegionValid; BRegion fContentRegion; - bool fContentRegionValid; BRegion fEffectiveDrawingRegion; - bool fEffectiveDrawingRegionValid; + + bool fVisibleContentRegionValid : 1; + bool fBorderRegionValid : 1; + bool fContentRegionValid : 1; + bool fEffectiveDrawingRegionValid : 1; ::RegionPool fRegionPool; BObjectList fSubsets; // TODO: remove those some day (let the decorator handle that stuff) - bool fIsClosing; - bool fIsMinimizing; - bool fIsZooming; - bool fIsResizing; - bool fIsSlidingTab; - bool fIsDragging; - bool fActivateOnMouseUp; + bool fIsClosing : 1; + bool fIsMinimizing : 1; + bool fIsZooming : 1; + bool fIsResizing : 1; + bool fIsSlidingTab : 1; + bool fIsDragging : 1; + bool fActivateOnMouseUp : 1; ::Decorator* fDecorator; ViewLayer* fTopLayer;