When a subwindow (i.e. one that overrides GetMainWindowOfCompositeControl() to
return a parent window) has focus, HasFocus() should return true for it too,
in addition to returning true for the main window.
This completes the fix of r69788.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69860
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
bool wxWindowBase::HasFocus() const
{
- return FindFocus() == this;
+ wxWindowBase* const win = DoFindFocus();
+ return win &&
+ (this == win || this == win->GetMainWindowOfCompositeControl());
}
// ----------------------------------------------------------------------------