Ticket #12187: wxWidgets-workswhenmodal.diff
File wxWidgets-workswhenmodal.diff, 1.4 KB (added by gmeeker, 11 years ago) |
---|
-
src/osx/cocoa/nonownedwnd.mm
14 14 #include "wx/nonownedwnd.h" 15 15 #include "wx/frame.h" 16 16 #include "wx/app.h" 17 #include "wx/dialog.h" 17 18 #endif 18 19 19 20 #include "wx/osx/private.h" … … 408 409 } 409 410 } 410 411 411 void wxNonOwnedWindowCocoaImpl::Create( wxWindow* WXUNUSED(parent), const wxPoint& pos, const wxSize& size,412 void wxNonOwnedWindowCocoaImpl::Create( wxWindow* parent, const wxPoint& pos, const wxSize& size, 412 413 long style, long extraStyle, const wxString& WXUNUSED(name) ) 413 414 { 414 415 static wxNonOwnedWindowController* controller = NULL; … … 516 517 defer:NO 517 518 ]; 518 519 520 // If the parent is modal, wxFRAME_FLOAT_ON_PARENT 521 // needs to be in kCGUtilityWindowLevel not kCGFloatingWindowLevel 522 // to stay above the parent. 523 // Cocoa's modal loop does not process other windows by default. 524 wxDialog* parentDialog = wxDynamicCast(parent, wxDialog); 525 if (parentDialog != NULL && parentDialog->IsModal() && 526 [m_macWindow isKindOfClass:[NSPanel class]]) 527 { 528 if (level == kCGFloatingWindowLevel) 529 { 530 level = kCGUtilityWindowLevel; 531 } 532 [(NSPanel*)m_macWindow setWorksWhenModal:YES]; 533 } 534 519 535 [m_macWindow setLevel:level]; 520 536 521 537 [m_macWindow setDelegate:controller];