]> git.saurik.com Git - wxWidgets.git/commitdiff
avoiding potential infinite recursion
authorStefan Csomor <csomor@advancedconcepts.ch>
Sun, 13 Sep 2009 17:34:51 +0000 (17:34 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sun, 13 Sep 2009 17:34:51 +0000 (17:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61912 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/iphone/window.mm

index fba3d8c8f719da2bba16c70f15d8837d899d4036..2858e3ccc3f68daf5779f0b6e2ec196c7112aba6 100644 (file)
@@ -368,8 +368,14 @@ wxWidgetIPhoneImpl::~wxWidgetIPhoneImpl()
 
 bool wxWidgetIPhoneImpl::IsVisible() const
 {
-    // TODO reflect Superviews state
-    return [m_osxView isHidden] == NO;
+    UIView* view = m_osxView;
+    while ( view != nil && [view isHidden] == NO )
+    {
+        view = [view superview];
+        if (view != nil && [view isHidden])
+            NSLog(@"visible test failed for %@",view); 
+    }
+    return view == nil;
 }
 
 void wxWidgetIPhoneImpl::SetVisibility( bool visible )
@@ -706,9 +712,12 @@ void wxWidgetIPhoneImpl::drawRect(CGRect* rect, WXWidget slf, void *WXUNUSED(_cm
         // call super
         SEL _cmd = @selector(drawRect:);
         wxOSX_DrawRectHandlerPtr superimpl = (wxOSX_DrawRectHandlerPtr) [[slf superclass] instanceMethodForSelector:_cmd];
-        superimpl(slf, _cmd, *rect);
-        CGContextRestoreGState( context );
-        CGContextSaveGState( context );
+        if ( superimpl != wxOSX_drawRect )
+        {
+            superimpl(slf, _cmd, *rect);
+            CGContextRestoreGState( context );
+            CGContextSaveGState( context );
+        }
     }
     wxpeer->MacPaintChildrenBorders();
     wxpeer->MacSetCGContextRef( NULL );