From 8eee00f687bcc8070574cc20a51b015c372c2947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 22 Jun 2005 17:28:24 +0000 Subject: [PATCH] No longer draws hidden views (the app_server still handles them wrong, though, when they are hidden while being attached to the window). DrawAfterChildren() is now called at the appropriate place. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13224 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Window.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index 46f8fa04cf..9ec95f64d7 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -2866,20 +2866,22 @@ BWindow::drawAllViews(BView* aView) void -BWindow::DoUpdate(BView *aView, BRect &area) +BWindow::DoUpdate(BView *view, BRect &area) { - STRACE(("info: BWindow::DoUpdate() BRect(%f,%f,%f,%f) called.\n", area.left, area.top, area.right, area.bottom)); - aView->check_lock(); + // don't draw hidden views or their children + if (view->IsHidden(view)) + return; - // ToDo: DrawAfterChildren() is not called at all! + view->check_lock(); - if (aView->Flags() & B_WILL_DRAW) { - aView->PushState(); - aView->Draw(area); - aView->PopState(); + if (view->Flags() & B_WILL_DRAW) { + // ToDo: make states robust + view->PushState(); + view->Draw(area); + view->PopState(); } else { // The code below is certainly not correct, because // it redoes what the app_server already did @@ -2891,7 +2893,7 @@ BWindow::DoUpdate(BView *aView, BRect &area) aView->SetHighColor(c);*/ } - BView *child = aView->first_child; + BView *child = view->first_child; while (child) { if (area.Intersects(child->Frame())) { BRect newArea = area & child->Frame(); @@ -2901,6 +2903,12 @@ BWindow::DoUpdate(BView *aView, BRect &area) } child = child->next_sibling; } + + if (view->Flags() & B_WILL_DRAW) { + view->PushState(); + view->DrawAfterChildren(area); + view->PopState(); + } }