From ee7cf06d20a2a58ed7c71b2bced704939861486a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Fri, 25 Apr 2008 10:00:37 +0000 Subject: [PATCH] * Added link flushing where the change is supposed to happen as soon as possible on the server side (for example Show() and Hide() need to be immediate). But also SetViewColor() and a few others. This fixes the bug encountered in Pairs. * Removed NOTE in DrawAfterChildren(), since it was outdated. * Corrected a typo in a comment. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25145 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/View.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index 2b8409c994..fbe8be1db6 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -881,6 +881,7 @@ BView::SetFlags(uint32 flags) fOwner->fLink->StartMessage(AS_VIEW_SET_FLAGS); fOwner->fLink->Attach(flags); + fOwner->fLink->Flush(); } } @@ -912,6 +913,7 @@ BView::Hide() if (fOwner && fShowLevel == 0) { _CheckLockAndSwitchCurrent(); fOwner->fLink->StartMessage(AS_VIEW_HIDE); + fOwner->fLink->Flush(); } fShowLevel++; @@ -927,6 +929,7 @@ BView::Show() if (fOwner && fShowLevel == 0) { _CheckLockAndSwitchCurrent(); fOwner->fLink->StartMessage(AS_VIEW_SHOW); + fOwner->fLink->Flush(); } if (fShowLevel == 0 && fParent) @@ -1165,12 +1168,7 @@ BView::Draw(BRect updateRect) void BView::DrawAfterChildren(BRect r) { - // HOOK function - - // NOTE: DrawAfterChildren is called if the corresponding - // flag is set, but it will currently not work as expected, - // since the app_server does not allow views to draw *on* - // their children + // Hook function STRACE(("\tHOOK: BView(%s)::DrawAfterChildren()\n", Name())); } @@ -1293,6 +1291,7 @@ BView::BeginRectTracking(BRect startRect, uint32 style) fOwner->fLink->StartMessage(AS_VIEW_BEGIN_RECT_TRACK); fOwner->fLink->Attach(startRect); fOwner->fLink->Attach(style); + fOwner->fLink->Flush(); } } @@ -1300,8 +1299,10 @@ BView::BeginRectTracking(BRect startRect, uint32 style) void BView::EndRectTracking() { - if (_CheckOwnerLockAndSwitchCurrent()) + if (_CheckOwnerLockAndSwitchCurrent()) { fOwner->fLink->StartMessage(AS_VIEW_END_RECT_TRACK); + fOwner->fLink->Flush(); + } } @@ -2101,6 +2102,7 @@ BView::SetViewColor(rgb_color color) fOwner->fLink->StartMessage(AS_VIEW_SET_VIEW_COLOR); fOwner->fLink->Attach(color); + fOwner->fLink->Flush(); fState->valid_flags |= B_VIEW_VIEW_COLOR_BIT; } @@ -2277,7 +2279,7 @@ BView::GetClippingRegion(BRegion* region) const return; // NOTE: the client has no idea when the clipping in the server - // changed, so it is always read from the serber + // changed, so it is always read from the server region->MakeEmpty(); if (fOwner) {