From 06ffd1dbabcb0de47ea7ceecbbee7e3af697bf99 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 8 Jul 2020 23:44:35 +0200 Subject: [PATCH] Revert SetFocus() change for GTK 2 to fix the GUI tests suite Limit the changes of d06e97e8d9 (Make sure toplevel is active in SetFocus(), 2020-07-08) to GTK 3 only as they break GTK 2 GUI test suite, resulting in many CI failures. See #18783. --- src/gtk/window.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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;