]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/nonownedwnd.mm
Use the correct window as parent of wxInfoBar close button.
[wxWidgets.git] / src / osx / cocoa / nonownedwnd.mm
index 1d5475532bd47716cfe042f655ed15d88f426271..7f73ffed916ecec4a2a79ceba9417cc001716e00 100644 (file)
@@ -111,7 +111,7 @@ bool shouldHandleSelector(SEL selector)
     return (wxNonOwnedWindowCocoaImpl*) wxNonOwnedWindowImpl::FindFromWXWindow( self );
 }
 
-// TODO in cocoa everything during a drag is sent to the NSWindow the mouse down occured, 
+// TODO in cocoa everything during a drag is sent to the NSWindow the mouse down occurred,
 // this does not conform to the wx behaviour if the window is not captured, so try to resend
 // or capture all wx mouse event handling at the tlw as we did for carbon
 
@@ -688,7 +688,8 @@ bool wxNonOwnedWindowCocoaImpl::Show(bool show)
         if ( wxpeer )
         {
             // add to parent window before showing
-            if ( wxpeer->GetParent() )
+            wxDialog * const dialog = wxDynamicCast(wxpeer, wxDialog);
+            if ( wxpeer->GetParent() && dialog && dialog->IsModal())
             {
                 NSView * parentView = wxpeer->GetParent()->GetPeer()->GetWXWidget();
                 if ( parentView )