From dace99a4efdbf2bd93f26fd35fe7630a835ca711 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 27 Mar 2012 11:58:05 +0000 Subject: [PATCH] Use IsDescendant() in wxTopLevelWindow::IsActive() implementation. Avoid wxGetTopLevelParent() which doesn't work for the strange TLWs which override IsTopLevel() to return false, as wxMDIChildFrame does in wxMSW. Using IsDescendant() works in any case and also is arguably more clear. Closes #3063. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71025 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/toplevel.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/wx/toplevel.h b/include/wx/toplevel.h index 0e46dfc3e4..9f0c365d40 100644 --- a/include/wx/toplevel.h +++ b/include/wx/toplevel.h @@ -224,7 +224,9 @@ public: virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO); // Is this the active frame (highlighted in the taskbar)? - virtual bool IsActive() { return wxGetTopLevelParent(FindFocus()) == this; } + // + // A TLW is active only if it contains the currently focused window. + virtual bool IsActive() { return IsDescendant(FindFocus()); } // this function may be overridden to return false to allow closing the // application even when this top level window is still open -- 2.50.0