diff --git a/src/servers/app/Layer.cpp b/src/servers/app/Layer.cpp index bf80802c6c..ced66286da 100644 --- a/src/servers/app/Layer.cpp +++ b/src/servers/app/Layer.cpp @@ -2404,9 +2404,12 @@ Layer::get_user_regions(BRegion ®) while (stackData) { if (stackData->ClippingRegion()) { // transform in screen coords - BRegion screenReg(*stackData->ClippingRegion()); - ConvertToScreen2(&screenReg); - reg.IntersectWith(&screenReg); +// NOTE: Already is in screen coords, but I leave this here in +// case we change it +// BRegion screenReg(*stackData->ClippingRegion()); +// ConvertToScreen2(&screenReg); +// reg.IntersectWith(&screenReg); + reg.IntersectWith(stackData->ClippingRegion()); } stackData = stackData->prevState; } diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index 88d0d213e5..8eb8fb9925 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -1088,26 +1088,13 @@ myRootLayer->Unlock(); fLink.Flush(); } else { // TODO: Watch out for the coordinate system in AS_LAYER_GET_CLIP_REGION - 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. - LayerData* layerData = fCurrentLayer->fLayerData; - - do { - if (layerData->ClippingRegion()) - region.IntersectWith(layerData->ClippingRegion()); - } while ((layerData = layerData->prevState) != NULL); - - int32 rectCount = region.CountRects(); + int32 rectCount = fCurrentLayer->fVisible.CountRects(); fLink.StartMessage(SERVER_TRUE); fLink.Attach(rectCount); for (int32 i = 0; i < rectCount; i++) - fLink.Attach(fCurrentLayer->ConvertFromTop(region.RectAt(i))); + fLink.Attach(fCurrentLayer->ConvertFromTop(fCurrentLayer->fVisible.RectAt(i))); fLink.Flush(); } @@ -1129,9 +1116,14 @@ myRootLayer->Unlock(); link.Read(&r); region.Include(fCurrentLayer->ConvertToTop(r)); } - fCurrentLayer->fLayerData->SetClippingRegion(region); +// TODO: Turned off user clipping for now (will probably not harm anything but performance right now) +// We need to integrate user clipping more, in Layer::PopState, the clipping needs to be +// restored too. "AS_LAYER_SET_CLIP_REGION" is irritating, as I think it should be +// "AS_LAYER_CONSTRAIN_CLIP_REGION", since it means to "add" to the current clipping, not "set" it. +// fCurrentLayer->fLayerData->SetClippingRegion(region); #ifndef NEW_CLIPPING - fCurrentLayer->RebuildFullRegion(); +// TODO: set the clipping +// fCurrentLayer->fVisible.IntersectWith(®ion); #endif /* #ifndef NEW_CLIPPING