AS_LAYER_GET_CLIP_REGION missed a Flush() in case the view was not hidden,

and that put apps that used it to sleep (for example, Tracker is using it).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13433 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-07-05 01:19:01 +00:00
parent b1e04bcb5c
commit f5d8fa6e60
+17 -22
View File
@@ -995,39 +995,34 @@ myRootLayer->Unlock();
DTRACE(("ServerWindow %s: Message AS_LAYER_GET_CLIP_REGION: Layer: %s\n", Title(), fCurrentLayer->Name())); DTRACE(("ServerWindow %s: Message AS_LAYER_GET_CLIP_REGION: Layer: %s\n", Title(), fCurrentLayer->Name()));
// if this Layer is hidden, it is clear that its visible region is void. // if this Layer is hidden, it is clear that its visible region is void.
if (fCurrentLayer->IsHidden()) if (fCurrentLayer->IsHidden()) {
{
fLink.StartMessage(SERVER_TRUE); fLink.StartMessage(SERVER_TRUE);
fLink.Attach<int32>(0L); fLink.Attach<int32>(0L);
fLink.Flush(); } else {
}
else
{
// TODO: Watch out for the coordinate system in AS_LAYER_GET_CLIP_REGION // TODO: Watch out for the coordinate system in AS_LAYER_GET_CLIP_REGION
BRegion reg; LayerData* layerData = fCurrentLayer->fLayerData;
LayerData *ld; BRegion region;
int32 noOfRects;
ld = fCurrentLayer->fLayerData;
if (ld->ClippingRegion())
reg.IntersectWith(ld->ClippingRegion());
// TODO: This could also be done more reliably in the Layer, // TODO: This could also be done more reliably in the Layer,
// when the State stack is implemented there. There should be // when the State stack is implemented there. There should be
// DrawData::fCulmulatedClippingRegion... // DrawData::fCulmulatedClippingRegion...
// TODO: the DrawData clipping region should be in local view coords. // TODO: the DrawData clipping region should be in local view coords.
while ((ld = ld->prevState)) {
if (ld->ClippingRegion())
reg.IntersectWith(ld->ClippingRegion());
}
noOfRects = reg.CountRects(); do {
if (layerData->ClippingRegion())
region.IntersectWith(layerData->ClippingRegion());
} while ((layerData = layerData->prevState) != NULL);
int32 rectCount = region.CountRects();
fLink.StartMessage(SERVER_TRUE); fLink.StartMessage(SERVER_TRUE);
fLink.Attach<int32>(noOfRects); fLink.Attach<int32>(rectCount);
for(int i = 0; i < noOfRects; i++) for (int32 i = 0; i < rectCount; i++)
fLink.Attach<BRect>(reg.RectAt(i)); fLink.Attach<BRect>(region.RectAt(i));
} }
fLink.Flush();
break; break;
} }
case AS_LAYER_SET_CLIP_REGION: case AS_LAYER_SET_CLIP_REGION: