From 4f5921d16e9d7df6b56bf057feaf88d25210e1cc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 25 Feb 2008 18:36:48 +0000 Subject: [PATCH] return true from IsShownOnScreen() for TLWs even if their parent is hidden [backport of r50876 from trunk] git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@52095 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/wincmn.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 23f8a98a83..d01360f22f 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -891,12 +891,11 @@ bool wxWindowBase::Enable(bool enable) bool wxWindowBase::IsShownOnScreen() const { -#ifdef __WXMAC__ - return ((wxWindowMac*)this)->MacIsReallyShown(); -#else + // A window is shown on screen if it itself is shown and so are all its + // parents. But if a window is toplevel one, then its always visible on + // screen if IsShown() returns true, even if it has a hidden parent. return IsShown() && - (GetParent() == NULL || GetParent()->IsShownOnScreen()); -#endif + (IsTopLevel() || !GetParent() || GetParent()->IsShownOnScreen()); } // ----------------------------------------------------------------------------