From: Vadim Zeitlin Date: Fri, 18 Nov 2011 23:40:53 +0000 (+0000) Subject: Fix HasFocus() for composite controls. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ec90f7158e79f18f26f0f4e43497534254a9d0da Fix HasFocus() for composite controls. Comparing the result of DoFindFocus() with the main window of composite control doesn't work as it can return a child window so HasFocus() still returned false for a composite control such as generic wxListCtrl even when it did have focus. Just use FindFocus() instead of DoFindFocus() to fix this. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69788 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index a8fee41792..16f1ed9da8 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -3328,9 +3328,7 @@ void wxWindowBase::DoMoveInTabOrder(wxWindow *win, WindowOrder move) bool wxWindowBase::HasFocus() const { - wxWindowBase *win = DoFindFocus(); - return win == this || - win == wxConstCast(this, wxWindowBase)->GetMainWindowOfCompositeControl(); + return FindFocus() == this; } // ----------------------------------------------------------------------------