From 4b5a12ecea0b35b83f4f1e918f2c5cf6cfa451b9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 25 Nov 2012 23:17:56 +0000 Subject: [PATCH] Fix TAB navigation in wxGTK broken by r72663. Don't call SetCanFocus(true) for container windows with focusable children, this doesn't play well at all with wxGTK focus handling and in particular totally disabled TAB navigation. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73018 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/containr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/containr.cpp b/src/common/containr.cpp index ecc7570e70..fbd3ea33d2 100644 --- a/src/common/containr.cpp +++ b/src/common/containr.cpp @@ -54,7 +54,10 @@ bool wxControlContainerBase::UpdateCanFocusChildren() { m_acceptsFocusChildren = acceptsFocusChildren; - m_winParent->SetCanFocus(AcceptsFocusRecursively()); + // In the ports where it does something non trivial, the parent window + // should only be focusable if it doesn't have any focusable children + // (e.g. native focus handling in wxGTK totally breaks down otherwise). + m_winParent->SetCanFocus(m_acceptsFocusSelf && !m_acceptsFocusChildren); } return m_acceptsFocusChildren; -- 2.45.2