diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index b8f0fd9f0f..052c4bb984 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -4583,9 +4583,13 @@ void wxWindowGTK::SetFocus() if (gs_currentFocus != this) gs_pendingFocus = this; + // We can't do this under GTK 2 as it breaks the GUI tests suite, but GTK 3 + // tests are robust enough to pass even if we do this. +#ifdef __WXGTK3__ wxWindow* tlw = wxGetTopLevelParent(static_cast(this)); if (tlw && tlw->m_widget && !gtk_window_is_active(GTK_WINDOW(tlw->m_widget))) tlw->Raise(); +#endif // __WXGTK3__ GtkWidget *widget = m_wxwindow ? m_wxwindow : m_focusWidget;