]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/listbox.cpp
added a check which should prevent the crash of bug 555111
[wxWidgets.git] / src / gtk / listbox.cpp
index afdac346504226cb169136cc376f4a1eca99c17f..4eefc235d3fd5ca07e2ea6b9705f2cf625f1d943 100644 (file)
@@ -59,9 +59,10 @@ extern bool g_isIdle;
 // data
 //-----------------------------------------------------------------------------
 
-extern bool       g_blockEventsOnDrag;
-extern bool       g_blockEventsOnScroll;
-extern wxCursor   g_globalCursor;
+extern bool           g_blockEventsOnDrag;
+extern bool           g_blockEventsOnScroll;
+extern wxCursor       g_globalCursor;
+extern wxWindowGTK   *g_delayedFocus;
 
 static bool       g_hasDoubleClicked = FALSE;
 
@@ -1023,6 +1024,15 @@ void wxListBox::OnInternalIdle()
         }
     }
 
+    if (g_delayedFocus == this)
+    {
+        if (GTK_WIDGET_REALIZED(m_widget))
+        {
+            gtk_widget_grab_focus( m_widget );
+            g_delayedFocus = NULL;
+        }
+    }
+
     UpdateWindowUI();
 }