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
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user