X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ba808e24125f0b777bff51566d55ff1c191293d3..cd318cd31b8fd9876af7ba5f4878b90f446bd0f5:/src/cocoa/app.mm diff --git a/src/cocoa/app.mm b/src/cocoa/app.mm index 54d1f42267..d1676de387 100644 --- a/src/cocoa/app.mm +++ b/src/cocoa/app.mm @@ -87,7 +87,6 @@ WX_IMPLEMENT_POSER(wxPoserNSApplication); { wxASSERT(wxTheApp); wxASSERT(wxMenuBarManager::GetInstance()); - wxMenuBarManager::GetInstance()->CocoaInternalIdle(); wxLogDebug("doIdle called"); #ifdef __WXDEBUG__ if(wxTheApp->IsInAssert()) @@ -174,10 +173,11 @@ bool wxApp::Initialize(int& argc, wxChar **argv) if ( argc > 1 ) { static const wxChar *ARG_PSN = _T("-psn_"); - if ( wxStrncmp(argv[1], ARG_PSN, sizeof(ARG_PSN) - 1) == 0 ) + if ( wxStrncmp(argv[1], ARG_PSN, strlen(ARG_PSN)) == 0 ) { // remove this argument - memmove(argv, argv + 1, argc--); + --argc; + memmove(argv + 1, argv + 2, argc * sizeof(char *)); } } @@ -239,6 +239,16 @@ void wxApp::CocoaInstallIdleHandler() // Call doIdle for EVERYTHING dammit // We'd need Foundation/NSConnection.h for this next constant, do we need it? [[ NSRunLoop currentRunLoop ] performSelector:@selector(doIdle:) target:m_cocoaAppDelegate argument:NULL order:0 modes:[NSArray arrayWithObjects:NSDefaultRunLoopMode, /* NSConnectionReplyRunLoopMode,*/ NSModalPanelRunLoopMode, /**/NSEventTrackingRunLoopMode,/**/ nil] ]; + /* Notes: + In the Mac OS X implementation of Cocoa, the above method schedules + doIdle: to be called from *within* [NSApplication + -nextEventMatchingMask:untilDate:inMode:dequeue:]. That is, no + NSEvent object is generated and control does not return from that + method. In fact, control will only return from that method for the + usual reasons (e.g. a real event is received or the untilDate is reached). + This has implications when trying to stop the event loop and return to + its caller. See wxEventLoop::Exit + */ } void wxApp::CocoaDelegate_applicationWillBecomeActive()