macOS 10.14 adaption for launch-opening files

The previous way to stop the event loop for wx-like OnInit processing was too early for 10.14, opening files during launch was not possible, see #18305
This commit is contained in:
Stefan Csomor
2019-01-03 17:49:20 +01:00
parent 142234d009
commit 66a9e55f3b

View File

@@ -68,6 +68,7 @@ void wxBell()
- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
[NSApp stop:nil];
wxTheApp->OSXOnDidFinishLaunching();
}
@@ -325,7 +326,6 @@ void wxBell()
// here we subclass NSApplication, for the purpose of being able to override sendEvent.
@interface wxNSApplication : NSApplication
{
BOOL firstPass;
}
- (id)init;
@@ -340,7 +340,7 @@ void wxBell()
{
if ( self = [super init] )
{
firstPass = YES;
// further init
}
return self;
}
@@ -370,14 +370,7 @@ void wxBell()
if ([anEvent type] == NSKeyUp && ([anEvent modifierFlags] & NSCommandKeyMask))
[[self keyWindow] sendEvent:anEvent];
else
[super sendEvent:anEvent];
if ( firstPass )
{
[NSApp stop:nil];
firstPass = NO;
return;
}
[super sendEvent:anEvent];
}
@end
@@ -416,12 +409,6 @@ bool wxApp::DoInitGui()
appcontroller = OSXCreateAppController();
[[NSApplication sharedApplication] setDelegate:(id <NSApplicationDelegate>)appcontroller];
[NSColor setIgnoresAlpha:NO];
// calling finishLaunching so early before running the loop seems to trigger some 'MenuManager compatibility' which leads
// to the duplication of menus under 10.5 and a warning under 10.6
#if 0
[NSApp finishLaunching];
#endif
}
gNSLayoutManager = [[NSLayoutManager alloc] init];