]> git.saurik.com Git - wxWidgets.git/commitdiff
toplevel window is shown on screen even if its parent is hidden
authorVáclav Slavík <vslavik@fastmail.fm>
Fri, 21 Dec 2007 13:53:41 +0000 (13:53 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Fri, 21 Dec 2007 13:53:41 +0000 (13:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50876 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/wincmn.cpp

index a417e77b60f16e11c3a167d583f5ff1733182897..dba13d85427e08a0789cfc061d1afe7e9b124c97 100644 (file)
@@ -881,8 +881,11 @@ bool wxWindowBase::Enable(bool enable)
 
 bool wxWindowBase::IsShownOnScreen() const
 {
+    // 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());
+           (IsTopLevel() || GetParent() == NULL || GetParent()->IsShownOnScreen());
 }
 
 // ----------------------------------------------------------------------------