X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b11708106f93d28dbb47218b18e02674ad6c0cdb..cfad3750c3ecc821ffae8b9b3de852551270846d:/src/gtk/window.cpp diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 3f46517907..9b1cb42717 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1257,6 +1257,13 @@ static void wxInsertChildInWindow( wxWindow* parent, wxWindow* child ) { parent->m_sizeSet = FALSE; } + + if (parent->m_windowStyle & wxTAB_TRAVERSAL) + { + /* we now allow a window to get the focus as long as it + doesn't have any children. */ + GTK_WIDGET_UNSET_FLAGS( parent->m_wxwindow, GTK_CAN_FOCUS ); + } } //----------------------------------------------------------------------------- @@ -1421,9 +1428,11 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id, gtk_viewport_set_shadow_type( viewport, GTK_SHADOW_NONE ); } - if ((m_windowStyle & wxTAB_TRAVERSAL) != 0) + if (m_windowStyle & wxTAB_TRAVERSAL) { - GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS ); /* changed from UNSET */ + /* we now allow a window to get the focus as long as it + doesn't have any children. */ + GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS ); m_acceptsFocus = FALSE; } else