]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dlgcmn.cpp
Forgot to commit the header change too.
[wxWidgets.git] / src / common / dlgcmn.cpp
index d99c8c0880bf6cc177c8694b185e0334bdd3df57..aa25908a2b4417103b4b5c759625ffa2a4fbfaa4 100644 (file)
@@ -480,7 +480,17 @@ void wxDialogBase::OnSysColourChanged(wxSysColourChangedEvent& event)
 bool wxDialogBase::DoLayoutAdaptation()
 {
     if (GetLayoutAdapter())
-        return GetLayoutAdapter()->DoLayoutAdaptation((wxDialog*) this);
+    {
+        wxWindow* focusWindow = wxFindFocusDescendant(this); // from event.h
+        if (GetLayoutAdapter()->DoLayoutAdaptation((wxDialog*) this))
+        {
+            if (focusWindow)
+                focusWindow->SetFocus();
+            return true;
+        }
+        else
+            return false;
+    }
     else
         return false;
 }