Make sure that a detached view is really no longer the focus view.

MakeFocus(false) can not be trusted, since it is virtual and might not call
the BView version.  


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24293 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2008-03-07 20:58:59 +00:00
parent 96e23ec325
commit 8dd37e7af9

View File

@ -4608,8 +4608,15 @@ BView::_Detach()
// make sure our owner doesn't need us anymore
if (fOwner->CurrentFocus() == this)
if (fOwner->CurrentFocus() == this) {
MakeFocus(false);
// MakeFocus() is virtual and might not be
// passing through to the BView version,
// but we need to make sure at this point
// that we are not the focus view anymore.
if (fOwner->CurrentFocus() == this)
fOwner->_SetFocus(NULL, true);
}
if (fOwner->fDefaultButton == this)
fOwner->SetDefaultButton(NULL);