From c7ad7fe18e8c8129450aab56e32c20a56a0faac0 Mon Sep 17 00:00:00 2001 From: Adi Oanca Date: Fri, 18 Jun 2004 19:13:06 +0000 Subject: [PATCH] Some imprudence for me. All decorators got (re)drawn instead of the one in question. Fixed that. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8055 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/server/Layer.cpp | 22 +++++++++++++------- src/servers/app/server/ServerWindow.cpp | 27 ++++++++++++------------- src/servers/app/server/WinBorder.cpp | 2 +- 3 files changed, 29 insertions(+), 22 deletions(-) diff --git a/src/servers/app/server/Layer.cpp b/src/servers/app/server/Layer.cpp index 094e9c4482..ab8d249dc3 100644 --- a/src/servers/app/server/Layer.cpp +++ b/src/servers/app/server/Layer.cpp @@ -432,8 +432,8 @@ void Layer::RequestDraw(const BRegion ®, Layer *startFrom) if (fVisible.CountRects() > 0) { fUpdateReg = fVisible; - if (!(fFlags & B_FULL_UPDATE_ON_RESIZE)) - fUpdateReg.IntersectWith(®); + if (fFlags & B_FULL_UPDATE_ON_RESIZE){ } + else { fUpdateReg.IntersectWith(®); } if (fUpdateReg.CountRects() > 0){ fDriver->ConstrainClippingRegion(&fUpdateReg); @@ -451,7 +451,14 @@ void Layer::RequestDraw(const BRegion ®, Layer *startFrom) redraw = true; if (redraw && !(lay->IsHidden())) - lay->RequestDraw(reg, NULL); + { + // no need to go deeper if not even the FullVisible region intersects + // Update one. + BRegion common(lay->fFullVisible); + common.IntersectWith(®); + if (common.CountRects() > 0) + lay->RequestDraw(reg, NULL); + } } } @@ -460,10 +467,11 @@ void Layer::Draw(const BRect &r) // TODO/NOTE: this should be an empty method! the next lines are for testing only STRACE(("Layer::Draw() Called\n")); - - // RGBColor col(152,102,51); - // DRIVER->FillRect_(r, 1, col, &fUpdateReg); - //snooze(1000000); +/* + RGBColor col(152,102,51); + fDriver->FillRect(fUpdateReg.Frame(), col); + snooze(1000000); +*/ fDriver->FillRect(r, fLayerData->viewcolor); // empty HOOK function. diff --git a/src/servers/app/server/ServerWindow.cpp b/src/servers/app/server/ServerWindow.cpp index c194115c31..ade122ff73 100644 --- a/src/servers/app/server/ServerWindow.cpp +++ b/src/servers/app/server/ServerWindow.cpp @@ -731,8 +731,7 @@ Layer * ServerWindow::CreateLayerTree(Layer *localRoot) delete name; // there is no way of setting this, other than manually :-) -printf("Layer (%s) hidden : %d?\n", fTitle.String(), hidden); - newLayer->fHidden = (hidden == 0)? false: true; + newLayer->fHidden = hidden; int32 dummyMsg; @@ -1667,6 +1666,18 @@ void ServerWindow::DispatchMessage(int32 code) break; } + case AS_WINDOW_MOVE: + { + float xMoveBy; + float yMoveBy; + + fSession->ReadFloat(&xMoveBy); + fSession->ReadFloat(&yMoveBy); + + fWinBorder->MoveBy(xMoveBy, yMoveBy); + + break; + } case B_MINIMIZE: { // TODO: Implement @@ -1685,18 +1696,6 @@ void ServerWindow::DispatchMessage(int32 code) STRACE(("ServerWindow %s: Message Zoom unimplemented\n",fTitle.String())); break; } - case B_WINDOW_MOVE_TO: - { - // TODO: Implement - STRACE(("ServerWindow %s: Message Move_To unimplemented\n",fTitle.String())); - break; - } - case B_WINDOW_MOVE_BY: - { - // TODO: Implement - STRACE(("ServerWindow %s: Message Move_By unimplemented\n",fTitle.String())); - break; - } default: { printf("ServerWindow %s received unexpected code - message offset %lx\n",fTitle.String(), code - SERVER_TRUE); diff --git a/src/servers/app/server/WinBorder.cpp b/src/servers/app/server/WinBorder.cpp index 9a3c7c1f51..b6f658216d 100644 --- a/src/servers/app/server/WinBorder.cpp +++ b/src/servers/app/server/WinBorder.cpp @@ -347,7 +347,7 @@ void WinBorder::Draw(const BRect &r) if(fDecorator) { /* - fUpdateReg.PrintToStream(); + //fUpdateReg.PrintToStream(); RGBColor c(128, 56, 98); //fDriver->FillRect(r, c); fDriver->FillRect(fUpdateReg.Frame(), c);