]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't assert if the window doesn't accept the focus.
authorJulian Smart <julian@anthemion.co.uk>
Tue, 20 Sep 2005 11:18:04 +0000 (11:18 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 20 Sep 2005 11:18:04 +0000 (11:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35615 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/x11/window.cpp

index 82239d1163ae37afd5487632550f15419821573f..64a7d0857c3f90ac1fc2aa2e3993148e40f9ecd9 100644 (file)
@@ -370,7 +370,11 @@ void wxWindowX11::SetFocus()
 
     wxCHECK_RET( xwindow, wxT("invalid window") );
 
-    wxCHECK_RET( AcceptsFocus(), wxT("set focus on window that doesn't accept the focus") );
+    // Don't assert; we might be trying to set the focus for a panel
+    // with only static controls, so the panel returns false from AcceptsFocus.
+    // The app should be not be expected to deal with this.
+    if (!AcceptsFocus())
+        return;
 
 #if 0
     if (GetName() == "scrollBar")