Don't recurse upwards when updating pending focus in wxMSW

This is unnecessary, we only need to update the pending focus in the
immediate parent window to prevent a wrong radio button from being
focused (and hence selected) when it regains focus, there is no good
reason at all to interfere with the focus in the grandparent (and
higher) windows.

Doing this was not only useless, but actually harmful, as it overrode
explicit calls to SetFocus() in the user code, so just stop doing it.
This also allows to avoid having 2 functions related to this and keep
just a single virtual WXSetPendingFocus() one.

Closes #18653.
This commit is contained in:
Vadim Zeitlin
2020-01-20 13:16:41 +01:00
parent 724621929d
commit ec07635801
5 changed files with 30 additions and 32 deletions

View File

@@ -585,12 +585,11 @@ public:
static bool MSWClickButtonIfPossible(wxButton* btn);
// This method is used for handling wxRadioButton-related complications,
// see wxRadioButton::SetValue(). It calls WXDoUpdatePendingFocus() for
// this window and all its parents up to the enclosing TLW, recursively.
void WXSetPendingFocus(wxWindow* win);
// Should be overridden by all classes storing the "last focused" window.
virtual void WXDoUpdatePendingFocus(wxWindow* WXUNUSED(win)) {}
// see wxRadioButton::SetValue().
//
// It should be overridden by all classes storing the "last focused"
// window to avoid focusing an unset radio button when regaining focus.
virtual void WXSetPendingFocus(wxWindow* WXUNUSED(win)) {}
// Called from WM_DPICHANGED handler for all windows to let them update
// any sizes and fonts used internally when the DPI changes and generate