AttachedToWindow() could be called twice in case new views were added during
AttachedToWindow(). This fixes the double team entries in the Deskbar. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15398 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -591,7 +591,7 @@ private:
|
|||||||
BScrollBar* fVerScroller;
|
BScrollBar* fVerScroller;
|
||||||
BScrollBar* fHorScroller;
|
BScrollBar* fHorScroller;
|
||||||
bool f_is_printing;
|
bool f_is_printing;
|
||||||
bool _unused_bool0;
|
bool fAttached;
|
||||||
bool _unused_bool1;
|
bool _unused_bool1;
|
||||||
bool _unused_bool2;
|
bool _unused_bool2;
|
||||||
BPrivate::ViewState* fState;
|
BPrivate::ViewState* fState;
|
||||||
|
|||||||
@@ -3274,14 +3274,11 @@ BView::AddChild(BView *child, BView *before)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!_AddChildToList(child, before))
|
if (!_AddChildToList(child, before))
|
||||||
debugger("AddChild failed - cannot find 'before' view.");
|
debugger("AddChild failed!");
|
||||||
|
|
||||||
if (fOwner) {
|
if (fOwner) {
|
||||||
check_lock();
|
check_lock();
|
||||||
|
|
||||||
STRACE(("BView(%s)::AddChild(child='%s' before='%s')... contacting app_server\n",
|
|
||||||
Name(), child ? child->Name() : "NULL", before ? before->Name() : "NULL"));
|
|
||||||
|
|
||||||
child->_SetOwner(fOwner);
|
child->_SetOwner(fOwner);
|
||||||
child->_CreateSelf();
|
child->_CreateSelf();
|
||||||
child->_Attach();
|
child->_Attach();
|
||||||
@@ -3766,6 +3763,7 @@ BView::_InitData(BRect frame, const char *name, uint32 resizingMode, uint32 flag
|
|||||||
fHorScroller = NULL;
|
fHorScroller = NULL;
|
||||||
|
|
||||||
f_is_printing = false;
|
f_is_printing = false;
|
||||||
|
fAttached = false;
|
||||||
|
|
||||||
fState = new BPrivate::ViewState;
|
fState = new BPrivate::ViewState;
|
||||||
|
|
||||||
@@ -4079,9 +4077,13 @@ void
|
|||||||
BView::_Attach()
|
BView::_Attach()
|
||||||
{
|
{
|
||||||
AttachedToWindow();
|
AttachedToWindow();
|
||||||
|
fAttached = true;
|
||||||
|
|
||||||
for (BView* child = fFirstChild; child != NULL; child = child->fNextSibling) {
|
for (BView* child = fFirstChild; child != NULL; child = child->fNextSibling) {
|
||||||
child->_Attach();
|
// we need to check for fAttachCalled as new views could have been
|
||||||
|
// added in AttachedToWindow() - and those are already attached
|
||||||
|
if (!child->fAttached)
|
||||||
|
child->_Attach();
|
||||||
}
|
}
|
||||||
|
|
||||||
AllAttached();
|
AllAttached();
|
||||||
@@ -4092,6 +4094,7 @@ void
|
|||||||
BView::_Detach()
|
BView::_Detach()
|
||||||
{
|
{
|
||||||
DetachedFromWindow();
|
DetachedFromWindow();
|
||||||
|
fAttached = false;
|
||||||
|
|
||||||
for (BView* child = fFirstChild; child != NULL; child = child->fNextSibling) {
|
for (BView* child = fFirstChild; child != NULL; child = child->fNextSibling) {
|
||||||
child->_Detach();
|
child->_Detach();
|
||||||
|
|||||||
Reference in New Issue
Block a user