diff --git a/src/servers/app/Layer.cpp b/src/servers/app/Layer.cpp index aeea253d32..df6d3261cb 100644 --- a/src/servers/app/Layer.cpp +++ b/src/servers/app/Layer.cpp @@ -557,7 +557,13 @@ void Layer::RequestDraw(const BRegion ®, Layer *startFrom) if (fUpdateReg.CountRects() > 0) { - SendUpdateMsg(); + if (!fOwner->fInUpdate) + { + fOwner->prevInvalid = fUpdateReg; + SendUpdateMsg(); + } + else + fOwner->zUpdateReg.Include(&fUpdateReg); } // we're not that different than other. We too have an @@ -657,9 +663,9 @@ void Layer::UpdateStart() fInUpdate = true; if (fClassID == AS_WINBORDER_CLASS) { + // NOTE: don't worry, RooLayer is locked here. WinBorder *wb = (WinBorder*)this; - wb->yUpdateReg = wb->zUpdateReg; - wb->zUpdateReg.MakeEmpty(); + wb->yUpdateReg = wb->prevInvalid; } fClipReg = &fUpdateReg; } @@ -672,6 +678,15 @@ void Layer::UpdateEnd() { WinBorder *wb = (WinBorder*)this; wb->yUpdateReg.MakeEmpty(); + wb->zUpdateReg.Exclude(&wb->prevInvalid); + if (wb->zUpdateReg.CountRects() > 0) + { + wb->prevInvalid = wb->zUpdateReg; + fUpdateReg = wb->zUpdateReg; + SendUpdateMsg(); + } + else + wb->prevInvalid.MakeEmpty(); } fInUpdate = false; diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index fcc838a298..4b60457d2a 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -1416,7 +1416,9 @@ void ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link) case AS_END_UPDATE: { DTRACE(("ServerWindowo %s: AS_END_UPDATE\n",fTitle.String())); + fWinBorder->GetRootLayer()->Lock(); cl->UpdateEnd(); + fWinBorder->GetRootLayer()->Unlock(); break; } @@ -1649,7 +1651,7 @@ void ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link) { fWinBorder->GetRootLayer()->Lock(); BRegion rreg(cl->fVisible); - rreg.Include(&fWinBorder->zUpdateReg); + rreg.Include(&fWinBorder->yUpdateReg); desktop->GetDisplayDriver()->ConstrainClippingRegion(&rreg); diff --git a/src/servers/app/WinBorder.h b/src/servers/app/WinBorder.h index 31e7ba6e3d..d2367e46c9 100644 --- a/src/servers/app/WinBorder.h +++ b/src/servers/app/WinBorder.h @@ -114,6 +114,7 @@ protected: BRegion zUpdateReg; BRegion yUpdateReg; + BRegion prevInvalid; int32 fMouseButtons; int32 fKeyModifiers;