Make sure toplevel is active in SetFocus(), episode 2
Toplevel must be active for child to actually receive focus See #18783
This commit is contained in:
@@ -4583,6 +4583,13 @@ void wxWindowGTK::SetFocus()
|
|||||||
if (gs_currentFocus != this)
|
if (gs_currentFocus != this)
|
||||||
gs_pendingFocus = this;
|
gs_pendingFocus = this;
|
||||||
|
|
||||||
|
// Toplevel must be active for child to actually receive focus.
|
||||||
|
// But avoid activating if tlw is not yet shown, as that will
|
||||||
|
// cause it to be immediately shown.
|
||||||
|
GtkWidget* tlw = gtk_widget_get_ancestor(m_widget, GTK_TYPE_WINDOW);
|
||||||
|
if (tlw && gtk_widget_get_visible(tlw) && !gtk_window_is_active(GTK_WINDOW(tlw)))
|
||||||
|
gtk_window_present(GTK_WINDOW(tlw));
|
||||||
|
|
||||||
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) &&
|
||||||
|
Reference in New Issue
Block a user