From 4d670342268c6e2e307ee825e246c23b524af4f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 16 Jun 2005 12:37:30 +0000 Subject: [PATCH] a new graphics state is pushed before calling BView::Draw() and popped after it. So any state changes you do in your Draw() function will be forgotton when you're done, as on R5. I have not done a lot of testing for bugs in the state stack within the app_server though... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13174 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Window.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index 61d1e70e8d..46f8fa04cf 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -1896,8 +1896,7 @@ BWindow::Show() void BWindow::Hide() { - if (fShowLevel == 0) { - Lock(); + if (fShowLevel == 0 && Lock()) { fLink->StartMessage(AS_HIDE_WINDOW); fLink->Flush(); Unlock(); @@ -2877,13 +2876,19 @@ BWindow::DoUpdate(BView *aView, BRect &area) // ToDo: DrawAfterChildren() is not called at all! - if (aView->Flags() & B_WILL_DRAW) + if (aView->Flags() & B_WILL_DRAW) { + aView->PushState(); aView->Draw(area); - else { - rgb_color c = aView->HighColor(); + aView->PopState(); + } else { + // The code below is certainly not correct, because + // it redoes what the app_server already did + // Find out what happens if a view has ViewColor() = + // B_TRANSPARENT_COLOR but not B_WILL_DRAW +/* rgb_color c = aView->HighColor(); aView->SetHighColor(aView->ViewColor()); aView->FillRect(aView->Bounds(), B_SOLID_HIGH); - aView->SetHighColor(c); + aView->SetHighColor(c);*/ } BView *child = aView->first_child;