]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/popupcmn.cpp
Typo fix for GetSizer.
[wxWidgets.git] / src / common / popupcmn.cpp
index dd72510c5fc420d9bc7938b72f6ec1b0028e20e7..db3250b429b5df64b2ab6fba369a635abfa3155b 100644 (file)
@@ -354,6 +354,7 @@ void wxPopupWindowHandler::OnLeftDown(wxMouseEvent& event)
     wxWindow *sbar = NULL;
 
     wxWindow *win = (wxWindow *)event.GetEventObject();
+    
     switch ( win->HitTest(pos.x, pos.y) )
     {
         case wxHT_WINDOW_OUTSIDE:
@@ -418,8 +419,17 @@ 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();
+    }
+    
+    printf( "Dismiss now.\n" );
+    
+    m_popup->DismissAndNotify();
 }
 
 void wxPopupFocusHandler::OnKeyDown(wxKeyEvent& event)