]> git.saurik.com Git - wxWidgets.git/commitdiff
don't treat changing focus to popup's child as loosing it
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 17 Feb 2002 00:03:08 +0000 (00:03 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 17 Feb 2002 00:03:08 +0000 (00:03 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14264 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/popupcmn.cpp

index dd72510c5fc420d9bc7938b72f6ec1b0028e20e7..c17d528fbfbd90923a7475f52ebca00b52f810b0 100644 (file)
@@ -418,8 +418,14 @@ void wxPopupFocusHandler::OnKillFocus(wxFocusEvent& event)
 
     // when we lose focus we always disappear - unless it goes to the popup (in
     // which case we don't really lose it)
-    if ( event.GetWindow() != m_popup )
-        m_popup->DismissAndNotify();
+    wxWindow *win = event.GetWindow();
+    while ( win )
+    {
+        if ( win == m_popup )
+            return;
+        win = win->GetParent();
+    }
+    m_popup->DismissAndNotify();
 }
 
 void wxPopupFocusHandler::OnKeyDown(wxKeyEvent& event)