* Fixed view deletion: _CreateSelf() and RemoveSelf() are now symmetrical, removing

all those error output from the app_server.
* AS_LAYER_DELETE now gets a token, no longer frightening choice of parent.
* Removed locking in RemoveChild(); it has to be called locked now.
* Removed AS_LAYER_DELETE_ROOT as it's no longer needed.
* Removed support from BView for being PR3 compatible.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16424 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-02-16 14:43:33 +00:00
parent bd3d31b0ab
commit 62b5f42b35
3 changed files with 33 additions and 38 deletions
+11 -11
View File
@@ -3369,18 +3369,23 @@ BView::RemoveSelf()
// Remove this child from its parent
if (fOwner && fOwner->Lock()) {
BLooper* owner = fOwner;
BWindow* owner = fOwner;
check_lock_no_pick();
if (owner != NULL) {
_UpdateStateForRemove();
_Detach();
owner->Unlock();
}
if (!fParent || !fParent->_RemoveChildFromList(this))
return false;
if (owner != NULL && fTopLevelView) {
// the top level view is deleted by the app_server automatically
owner->fLink->StartMessage(AS_LAYER_DELETE);
owner->fLink->Attach<int32>(_get_object_token_(fParent));
}
STRACE(("DONE: BView(%s)::RemoveSelf()\n", Name()));
return true;
@@ -3974,7 +3979,7 @@ BView::_CreateSelf()
fOwner->fLink->Attach<uint32>(Flags());
fOwner->fLink->Attach<bool>(IsHidden(this));
fOwner->fLink->Attach<rgb_color>(fState->view_color);
if (fTopLevelView)
if (fTopLevelView)
fOwner->fLink->Attach<int32>(B_NULL_TOKEN);
else
fOwner->fLink->Attach<int32>(_get_object_token_(fParent));
@@ -4162,13 +4167,11 @@ BView::_Detach()
if (fOwner->fLastViewToken == _get_object_token_(this))
fOwner->fLastViewToken = B_NULL_TOKEN;
BWindow *owner = fOwner;
_SetOwner(NULL);
owner->fLink->StartMessage(AS_LAYER_DELETE);
}
}
void
BView::_Draw(BRect updateRectScreen)
{
@@ -4406,8 +4409,6 @@ void BView::_ReservedView5(){}
void BView::_ReservedView6(){}
void BView::_ReservedView7(){}
void BView::_ReservedView8(){}
#if !_PR3_COMPATIBLE_
void BView::_ReservedView9(){}
void BView::_ReservedView10(){}
void BView::_ReservedView11(){}
@@ -4416,7 +4417,6 @@ void BView::_ReservedView13(){}
void BView::_ReservedView14(){}
void BView::_ReservedView15(){}
void BView::_ReservedView16(){}
#endif
BView::BView(const BView &other)