]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/containr.cpp
moved wx/panel include to correct wxGTK compilation error
[wxWidgets.git] / src / common / containr.cpp
index 04a7794bfefc093259ef3f2484c9475f88a6c573..51a0e1744bd4c2369c192389a4a87656bdd50b75 100644 (file)
@@ -273,6 +273,23 @@ bool wxControlContainer::DoSetFocus()
     //
     // RR: Removed for now. Let's see what happens..
 
+    // if our child already has focus, don't take it away from it
+    wxWindow *win = wxWindow::FindFocus();
+    while ( win )
+    {
+        if ( win == m_winParent )
+            return TRUE;
+
+        if ( win->IsTopLevel() )
+        {
+            // don't look beyond the first top level parent - useless and
+            // unnecessary
+            break;
+        }
+
+        win = win->GetParent();
+    }
+
     return SetFocusToChild();
 }