From 0573400f8aca584bf9b73c2c7d27e4cbe0c1af4c Mon Sep 17 00:00:00 2001 From: Adi Oanca Date: Thu, 17 Jun 2004 14:39:21 +0000 Subject: [PATCH] Damn vi. I'll use nano next time. Sorry about my previous blank message. Trying to make windows visible again. :-)) Made decorator until now. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8033 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/server/Layer.cpp | 35 +++++++------------------ src/servers/app/server/ServerWindow.cpp | 16 ++++++----- src/servers/app/server/WinBorder.cpp | 22 +++++++++++----- 3 files changed, 35 insertions(+), 38 deletions(-) diff --git a/src/servers/app/server/Layer.cpp b/src/servers/app/server/Layer.cpp index 5bc3e64de1..2cd434906e 100644 --- a/src/servers/app/server/Layer.cpp +++ b/src/servers/app/server/Layer.cpp @@ -135,8 +135,10 @@ void Layer::AddChild(Layer *layer, ServerWindow *serverWin) // if no RootLayer, there is no need to set any parameters. // they will be set when the root Layer for this tree will be added // to the main tree structure. - if (fRootLayer == NULL) + if (fRootLayer == NULL){ + STRACE(("Layer(%s)::AddChild(%s) END\n", GetName(), layer->GetName())); return; + } // 2) set some fields for this new layer and its children. Layer *c = layer; //c = short for: current @@ -415,7 +417,7 @@ void Layer::Redraw(const BRegion& reg, Layer *startFrom) if (pReg->CountRects() > 0) RequestDraw(reg, startFrom); - STRACE(("Layer::Redraw ENDED\n")); + STRACE(("Layer(%s)::Redraw() ENDED\n", GetName())); } void Layer::RequestDraw(const BRegion ®, Layer *startFrom) @@ -433,31 +435,12 @@ void Layer::RequestDraw(const BRegion ®, Layer *startFrom) fUpdateReg.IntersectWith(®); if (fUpdateReg.CountRects() > 0){ - if (fServerWin){ - // clear background, *only IF* our view color is different to B_TRANSPARENT_COLOR! - // TODO: DO That! - // TODO: UNcomment!!! -// TODO !!! UPDATE code !!! - /* - BMessage msg; - msg.what = _UPDATE_; - msg.AddInt32("_token", fViewToken); - msg.AddRect("_rect", ConvertFromTop(reg.Frame()) ); + fDriver->ConstrainClippingRegion(&fUpdateReg); + Draw(fUpdateReg.Frame()); + fDriver->ConstrainClippingRegion(NULL); - // for test purposes only! - msg.AddRect("_rect2", reg.Frame()); - - fServerWin->SendMessageToClient( &msg ); - */ - } - else{ - // NOTE: do not clear background for internal server layers! - fDriver->ConstrainClippingRegion(&fUpdateReg); - Draw(fUpdateReg.Frame()); - fDriver->ConstrainClippingRegion(NULL); - - fUpdateReg.MakeEmpty(); - } +// TODO: (WARNING!): For the Update code is MUST not be emptied!!! + fUpdateReg.MakeEmpty(); } } diff --git a/src/servers/app/server/ServerWindow.cpp b/src/servers/app/server/ServerWindow.cpp index 63e009e508..5eec31ece3 100644 --- a/src/servers/app/server/ServerWindow.cpp +++ b/src/servers/app/server/ServerWindow.cpp @@ -277,7 +277,7 @@ void ServerWindow::Show(void) if(!fWinBorder->IsHidden()) return; - STRACE(("ServerWindow %s: Show\n",fTitle.String())); + STRACE(("ServerWindow (%s): Show()\n",fTitle.String())); if(fWinBorder) { RootLayer *rl = fWinBorder->GetRootLayer(); @@ -289,9 +289,9 @@ void ServerWindow::Show(void) rl->fMainLock.Lock(); STRACE(("ServerWindow(%s)::Show() - Main lock acquired\n", fWinBorder->GetName())); - // manually set fWinBorder->fHidden to false because Layer's version also calls FullInvalidate. - fWinBorder->fHidden=false; - + // TODO: 'false' couldn't this be made otherwise??? + fWinBorder->Show(false); + if ( (fFeel == B_FLOATING_SUBSET_WINDOW_FEEL || fFeel == B_MODAL_SUBSET_WINDOW_FEEL) && fWinBorder->MainWinBorder() == NULL) { @@ -319,6 +319,10 @@ void ServerWindow::Show(void) desktop->fGeneralLock.Unlock(); STRACE(("ServerWindow(%s)::Show() - General lock released\n", fWinBorder->GetName())); } + else + { + debugger("WARNING: NULL fWinBorder\n"); + } } //! Hides the window's WinBorder @@ -1511,13 +1515,13 @@ void ServerWindow::DispatchMessage(int32 code) } case AS_SHOW_WINDOW: { - STRACE(("ServerWindow %s: Message AS_SHOW\n",fTitle.String())); + STRACE(("ServerWindow %s: Message AS_SHOW_WINDOW\n",fTitle.String())); Show(); break; } case AS_HIDE_WINDOW: { - STRACE(("ServerWindow %s: Message AS_HIDE\n",fTitle.String())); + STRACE(("ServerWindow %s: Message AS_HIDE_WINDOW\n",fTitle.String())); Hide(); break; } diff --git a/src/servers/app/server/WinBorder.cpp b/src/servers/app/server/WinBorder.cpp index b2900681c7..622125fc73 100644 --- a/src/servers/app/server/WinBorder.cpp +++ b/src/servers/app/server/WinBorder.cpp @@ -46,7 +46,7 @@ // TODO: Document this file completely // Toggle general function call output -//#define DEBUG_WINBORDER +#define DEBUG_WINBORDER // toggle //#define DEBUG_WINBORDER_MOUSE @@ -344,9 +344,6 @@ void WinBorder::Draw(const BRect &r) // if we have a visible region, it is decorator's one. if(fDecorator) { - fUpdateReg = fVisible; - // restrict Decorator drawing to the update region only. - fDriver->ConstrainClippingRegion(&fUpdateReg); /* fUpdateReg.PrintToStream(); RGBColor c(128, 56, 98); @@ -355,9 +352,22 @@ void WinBorder::Draw(const BRect &r) snooze(1000000); */ fDecorator->Draw(fUpdateReg.Frame()); - // remove the additional clipping region. - fDriver->ConstrainClippingRegion(NULL); } + // clear background, *only IF* our view color is different to B_TRANSPARENT_COLOR! + // TODO: DO That! + // TODO: UNcomment!!! +// TODO !!! UPDATE code !!! + /* + BMessage msg; + msg.what = _UPDATE_; + msg.AddInt32("_token", fViewToken); + msg.AddRect("_rect", ConvertFromTop(reg.Frame()) ); + + // for test purposes only! + msg.AddRect("_rect2", reg.Frame()); + + fServerWin->SendMessageToClient( &msg ); +*/ } void WinBorder::MoveBy(float x, float y)