Make sure toplevel is active in SetFocus()

See #18783
This commit is contained in:
Paul Cornett 2020-07-08 08:52:12 -07:00
parent f07197e2ba
commit d06e97e8d9

View File

@ -4583,6 +4583,10 @@ void wxWindowGTK::SetFocus()
if (gs_currentFocus != this) if (gs_currentFocus != this)
gs_pendingFocus = this; gs_pendingFocus = this;
wxWindow* tlw = wxGetTopLevelParent(static_cast<wxWindow*>(this));
if (tlw && tlw->m_widget && !gtk_window_is_active(GTK_WINDOW(tlw->m_widget)))
tlw->Raise();
GtkWidget *widget = m_wxwindow ? m_wxwindow : m_focusWidget; GtkWidget *widget = m_wxwindow ? m_wxwindow : m_focusWidget;
if ( GTK_IS_CONTAINER(widget) && if ( GTK_IS_CONTAINER(widget) &&