From 8dd37e7af9b579201db264c185fcef517a1e2884 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Fri, 7 Mar 2008 20:58:59 +0000 Subject: [PATCH] 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 --- src/kits/interface/View.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index e1103dbc75..938e94bafb 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -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);