From 8648f839e7212962ae966ec896b0b3d378ef1761 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 26 Oct 2019 02:46:39 +0200 Subject: [PATCH] Don't accept focus for wxRadioBox itself in wxOSX The radio box is just a static box and so can't have focus, only its child radio buttons should have it. This resolves the problem with getting stuck on wxRadioBox when full keyboard access is off, as wxControlContainer code tried to give focus to wxRadioBox because its AcceptsFocusFromKeyboard() returned true, but none of its radio buttons could be focused without full keyboard access. However this introduces a new problem with wxRadioBox being skipped when full keyboard access is on, which will be fixed in the following commit. See #18089. --- src/osx/radiobox_osx.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/osx/radiobox_osx.cpp b/src/osx/radiobox_osx.cpp index 50dbb33b2f..2a7b33c827 100644 --- a/src/osx/radiobox_osx.cpp +++ b/src/osx/radiobox_osx.cpp @@ -102,6 +102,9 @@ bool wxRadioBox::Create( wxWindow *parent, if ( !wxControl::Create( parent, id, pos, size, style, val, name ) ) return false; + // The radio box itself never accepts focus, only its child buttons do. + m_container.DisableSelfFocus(); + // during construction we must keep this at 0, otherwise GetBestSize fails m_noItems = 0; m_noRowsOrCols = majorDim;