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.
This commit is contained in:
Vadim Zeitlin 2020-07-08 23:44:35 +02:00
parent d06e97e8d9
commit 06ffd1dbab

View File

@ -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<wxWindow*>(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;