From 4c6f8b572ef6ab4090238722bdcc741d015a3455 Mon Sep 17 00:00:00 2001 From: Adi Oanca Date: Wed, 30 Mar 2005 22:13:26 +0000 Subject: [PATCH] This fixes up those update request being lost. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12172 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/Layer.cpp | 21 ++++++++++++++++++--- src/servers/app/ServerWindow.cpp | 4 +++- src/servers/app/WinBorder.h | 1 + 3 files changed, 22 insertions(+), 4 deletions(-) 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;