]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/popupcmn.cpp
Fix warnings in rich text documentation.
[wxWidgets.git] / src / common / popupcmn.cpp
index 09d012c6c140cf91336268fb9e3526089f89ff66..49ef9c88571f6f9ba19cf5dd11320a5301501345 100644 (file)
@@ -265,8 +265,16 @@ void wxPopupTransientWindow::PopHandlers()
 
 void wxPopupTransientWindow::Popup(wxWindow *winFocus)
 {
+    // If we have a single child, we suppose that it must cover the entire
+    // popup window and hence we give the mouse capture to it instead of
+    // keeping it for ourselves.
+    //
+    // Notice that this works best for combobox-like popups which have a single
+    // control inside them and not so well for popups containing a single
+    // wxPanel with multiple children inside it but OTOH it does no harm in
+    // this case neither and we can't reliably distinguish between them.
     const wxWindowList& children = GetChildren();
-    if ( children.GetCount() )
+    if ( children.GetCount() == 1 )
     {
         m_child = children.GetFirst()->GetData();
     }