From f5d8fa6e6009205e4e4d823a722ade8fb425a4a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 5 Jul 2005 01:19:01 +0000 Subject: [PATCH] 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 --- src/servers/app/ServerWindow.cpp | 39 ++++++++++++++------------------ 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index 27256ef79b..2ab1948904 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -995,39 +995,34 @@ myRootLayer->Unlock(); 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 (fCurrentLayer->IsHidden()) - { + if (fCurrentLayer->IsHidden()) { fLink.StartMessage(SERVER_TRUE); fLink.Attach(0L); - fLink.Flush(); - } - else - { + } else { // TODO: Watch out for the coordinate system in AS_LAYER_GET_CLIP_REGION - BRegion reg; - LayerData *ld; - int32 noOfRects; - - ld = fCurrentLayer->fLayerData; - if (ld->ClippingRegion()) - reg.IntersectWith(ld->ClippingRegion()); - + LayerData* layerData = fCurrentLayer->fLayerData; + BRegion region; + // TODO: This could also be done more reliably in the Layer, // when the State stack is implemented there. There should be // DrawData::fCulmulatedClippingRegion... // 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.Attach(noOfRects); + fLink.Attach(rectCount); - for(int i = 0; i < noOfRects; i++) - fLink.Attach(reg.RectAt(i)); + for (int32 i = 0; i < rectCount; i++) + fLink.Attach(region.RectAt(i)); } + + fLink.Flush(); break; } case AS_LAYER_SET_CLIP_REGION: