'Attach' hooks are now called after the complete tree of children of the BView to be added is completely known by app_server
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11453 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+15
-14
@@ -3198,6 +3198,7 @@ BView::AddChild(BView *child, BView *before)
|
|||||||
|
|
||||||
child->setOwner(this->owner);
|
child->setOwner(this->owner);
|
||||||
attachView(child);
|
attachView(child);
|
||||||
|
callAttachHooks(child);
|
||||||
|
|
||||||
if (lockedByAddChild)
|
if (lockedByAddChild)
|
||||||
owner->Unlock();
|
owner->Unlock();
|
||||||
@@ -3733,26 +3734,18 @@ BView::removeSelf()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
void
|
||||||
BView::callDetachHooks(BView *aView)
|
BView::callDetachHooks(BView *aView)
|
||||||
{
|
{
|
||||||
// check_clock();
|
|
||||||
|
|
||||||
// call the hook function:
|
|
||||||
aView->DetachedFromWindow();
|
aView->DetachedFromWindow();
|
||||||
|
|
||||||
// we attach all its children
|
|
||||||
|
|
||||||
BView *child = aView->first_child;
|
BView *child = aView->first_child;
|
||||||
while (child != NULL) {
|
while (child != NULL) {
|
||||||
aView->callDetachHooks(child);
|
aView->callDetachHooks(child);
|
||||||
child = child->next_sibling;
|
child = child->next_sibling;
|
||||||
}
|
}
|
||||||
|
|
||||||
// call the hook function:
|
|
||||||
aView->AllDetached();
|
aView->AllDetached();
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -3819,6 +3812,19 @@ BView::addToList(BView *aView, BView *before)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BView::callAttachHooks(BView *aView)
|
||||||
|
{
|
||||||
|
aView->AttachedToWindow();
|
||||||
|
|
||||||
|
BView *child= aView->first_child;
|
||||||
|
while (child != NULL) {
|
||||||
|
aView->callAttachHooks(child);
|
||||||
|
child = child->next_sibling;
|
||||||
|
}
|
||||||
|
|
||||||
|
aView->AllAttached();
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
BView::attachView(BView *aView)
|
BView::attachView(BView *aView)
|
||||||
@@ -3851,9 +3857,6 @@ BView::attachView(BView *aView)
|
|||||||
|
|
||||||
aView->setCachedState();
|
aView->setCachedState();
|
||||||
|
|
||||||
// call the hook function:
|
|
||||||
aView->AttachedToWindow();
|
|
||||||
|
|
||||||
// we attach all its children
|
// we attach all its children
|
||||||
|
|
||||||
BView *child= aView->first_child;
|
BView *child= aView->first_child;
|
||||||
@@ -3862,8 +3865,6 @@ BView::attachView(BView *aView)
|
|||||||
child = child->next_sibling;
|
child = child->next_sibling;
|
||||||
}
|
}
|
||||||
|
|
||||||
// call the hook function:
|
|
||||||
aView->AllAttached();
|
|
||||||
owner->fLink->Flush();
|
owner->fLink->Flush();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user