diff --git a/native/atom_application.h b/native/atom_application.h index 895ec1876..3fbfbd812 100644 --- a/native/atom_application.h +++ b/native/atom_application.h @@ -5,10 +5,8 @@ class AtomCefClient; @interface AtomApplication : NSApplication { @private - NSWindow *_backgroundWindow; - - CefRefPtr _cefClient; - + NSWindowController *_backgroundWindowController; + BOOL handlingSendEvent_; } @@ -17,4 +15,4 @@ class AtomCefClient; - (IBAction)runSpecs:(id)sender; - (IBAction)runBenchmarks:(id)sender; -@end +@end \ No newline at end of file diff --git a/native/atom_application.mm b/native/atom_application.mm index b46dbecae..a27ad33e3 100644 --- a/native/atom_application.mm +++ b/native/atom_application.mm @@ -23,25 +23,11 @@ return settings; } - - (void)dealloc { - [_backgroundWindow release]; + [_backgroundWindowController release]; [super dealloc]; } -- (void)createBackgroundWindow { - _cefClient = new AtomCefClient(); - - CefWindowInfo window_info; - _backgroundWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 0, 0) styleMask:nil backing:nil defer:YES]; - window_info.SetAsChild([_backgroundWindow contentView], 0, 0, 0, 0); - - CefBrowserSettings settings; - NSURL *resourceDirURL = [[NSBundle mainBundle] resourceURL]; - NSString *indexURLString = [[resourceDirURL URLByAppendingPathComponent:@"index.html"] absoluteString]; - CefBrowserHost::CreateBrowser(window_info, _cefClient.get(), [indexURLString UTF8String], settings); -} - - (void)open:(NSString *)path { [[AtomWindowController alloc] initWithPath:path]; } @@ -77,7 +63,7 @@ # pragma mark NSApplicationDelegate - (void)applicationWillFinishLaunching:(NSNotification *)notification { - [self createBackgroundWindow]; + _backgroundWindowController = [[AtomWindowController alloc] initInBackground]; [self open:@""]; } @@ -98,10 +84,10 @@ - (void)sendEvent:(NSEvent*)event { CefScopedSendingEvent sendingEventScoper; if ([[self mainMenu] performKeyEquivalent:event]) return; - - if (_cefClient && ![self keyWindow] && [event type] == NSKeyDown) { - [_backgroundWindow makeKeyAndOrderFront:self]; - [_backgroundWindow sendEvent:event]; + + if (_backgroundWindowController && ![self keyWindow] && [event type] == NSKeyDown) { + [_backgroundWindowController.window makeKeyWindow]; + [_backgroundWindowController.window sendEvent:event]; } else { [super sendEvent:event]; diff --git a/native/atom_window_controller.h b/native/atom_window_controller.h index d8ab54bae..aa8b6acb7 100644 --- a/native/atom_window_controller.h +++ b/native/atom_window_controller.h @@ -16,6 +16,7 @@ class AtomCefClient; @property (nonatomic, retain) IBOutlet NSView *webView; - (id)initWithPath:(NSString *)path; +- (id)initInBackground; - (id)initSpecs; - (id)initBenchmarks; diff --git a/native/atom_window_controller.mm b/native/atom_window_controller.mm index 24e5d378c..8a973803d 100644 --- a/native/atom_window_controller.mm +++ b/native/atom_window_controller.mm @@ -13,26 +13,36 @@ [super dealloc]; } -- (id)initWithBootstrapScript:(NSString *)bootstrapScript { +- (id)initWithBootstrapScript:(NSString *)bootstrapScript background:(BOOL)background { self = [super initWithWindowNibName:@"AtomWindow"]; _bootstrapScript = [bootstrapScript retain]; - [self showWindow:self]; + if (!background) { + [self.window makeKey:self]; + } + + return self; } - (id)initWithPath:(NSString *)path { _pathToOpen = [path retain]; - return [self initWithBootstrapScript:@"window-bootstrap"]; + return [self initWithBootstrapScript:@"window-bootstrap" background:NO]; +} + +- (id)initInBackground { + [self initWithBootstrapScript:@"window-bootstrap" background:YES]; + [self.window setFrame:NSMakeRect(0, 0, 0, 0) display:NO]; + return self; } - (id)initSpecs { _runningSpecs = true; - return [self initWithBootstrapScript:@"spec-bootstrap"]; + return [self initWithBootstrapScript:@"spec-bootstrap" background:NO]; } - (id)initBenchmarks { - return [self initWithBootstrapScript:@"benchmark-bootstrap"]; + return [self initWithBootstrapScript:@"benchmark-bootstrap" background:NO]; } - (void)windowDidLoad { @@ -116,4 +126,4 @@ settings.fullscreen_enabled = true; } -@end +@end \ No newline at end of file diff --git a/native/frameworks/CocoaOniguruma.framework/Resources/Info.plist b/native/frameworks/CocoaOniguruma.framework/Resources/Info.plist index d466488d4..ccdedf455 100644 --- a/native/frameworks/CocoaOniguruma.framework/Resources/Info.plist +++ b/native/frameworks/CocoaOniguruma.framework/Resources/Info.plist @@ -2,37 +2,37 @@ - BuildMachineOSBuild - 11E2620 - CFBundleDevelopmentRegion - English - CFBundleExecutable - CocoaOniguruma - CFBundleIdentifier - net.limechat.CocoaOniguruma - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - CocoaOniguruma - CFBundlePackageType - FMWK - CFBundleSignature - ???? - CFBundleVersion - 1.0 - DTCompiler - - DTPlatformBuild - 4E3002 - DTPlatformVersion - GM - DTSDKBuild - 11E2620 - DTSDKName - - DTXcode - 0433 - DTXcodeBuild - 4E3002 + BuildMachineOSBuild + 11E2620 + CFBundleDevelopmentRegion + English + CFBundleExecutable + CocoaOniguruma + CFBundleIdentifier + net.limechat.CocoaOniguruma + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + CocoaOniguruma + CFBundlePackageType + FMWK + CFBundleSignature + ???? + CFBundleVersion + 1.0 + DTCompiler + + DTPlatformBuild + 4E3002 + DTPlatformVersion + GM + DTSDKBuild + 11E2620 + DTSDKName + + DTXcode + 0433 + DTXcodeBuild + 4E3002 diff --git a/native/frameworks/CocoaOniguruma.framework/Versions/A/Resources/Info.plist b/native/frameworks/CocoaOniguruma.framework/Versions/A/Resources/Info.plist index d466488d4..ccdedf455 100644 --- a/native/frameworks/CocoaOniguruma.framework/Versions/A/Resources/Info.plist +++ b/native/frameworks/CocoaOniguruma.framework/Versions/A/Resources/Info.plist @@ -2,37 +2,37 @@ - BuildMachineOSBuild - 11E2620 - CFBundleDevelopmentRegion - English - CFBundleExecutable - CocoaOniguruma - CFBundleIdentifier - net.limechat.CocoaOniguruma - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - CocoaOniguruma - CFBundlePackageType - FMWK - CFBundleSignature - ???? - CFBundleVersion - 1.0 - DTCompiler - - DTPlatformBuild - 4E3002 - DTPlatformVersion - GM - DTSDKBuild - 11E2620 - DTSDKName - - DTXcode - 0433 - DTXcodeBuild - 4E3002 + BuildMachineOSBuild + 11E2620 + CFBundleDevelopmentRegion + English + CFBundleExecutable + CocoaOniguruma + CFBundleIdentifier + net.limechat.CocoaOniguruma + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + CocoaOniguruma + CFBundlePackageType + FMWK + CFBundleSignature + ???? + CFBundleVersion + 1.0 + DTCompiler + + DTPlatformBuild + 4E3002 + DTPlatformVersion + GM + DTSDKBuild + 11E2620 + DTSDKName + + DTXcode + 0433 + DTXcodeBuild + 4E3002 diff --git a/native/frameworks/CocoaOniguruma.framework/Versions/Current/Resources/Info.plist b/native/frameworks/CocoaOniguruma.framework/Versions/Current/Resources/Info.plist index d466488d4..ccdedf455 100644 --- a/native/frameworks/CocoaOniguruma.framework/Versions/Current/Resources/Info.plist +++ b/native/frameworks/CocoaOniguruma.framework/Versions/Current/Resources/Info.plist @@ -2,37 +2,37 @@ - BuildMachineOSBuild - 11E2620 - CFBundleDevelopmentRegion - English - CFBundleExecutable - CocoaOniguruma - CFBundleIdentifier - net.limechat.CocoaOniguruma - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - CocoaOniguruma - CFBundlePackageType - FMWK - CFBundleSignature - ???? - CFBundleVersion - 1.0 - DTCompiler - - DTPlatformBuild - 4E3002 - DTPlatformVersion - GM - DTSDKBuild - 11E2620 - DTSDKName - - DTXcode - 0433 - DTXcodeBuild - 4E3002 + BuildMachineOSBuild + 11E2620 + CFBundleDevelopmentRegion + English + CFBundleExecutable + CocoaOniguruma + CFBundleIdentifier + net.limechat.CocoaOniguruma + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + CocoaOniguruma + CFBundlePackageType + FMWK + CFBundleSignature + ???? + CFBundleVersion + 1.0 + DTCompiler + + DTPlatformBuild + 4E3002 + DTPlatformVersion + GM + DTSDKBuild + 11E2620 + DTSDKName + + DTXcode + 0433 + DTXcodeBuild + 4E3002 diff --git a/native/mac/English.lproj/AtomWindow.xib b/native/mac/English.lproj/AtomWindow.xib index 625b34001..55524e321 100644 --- a/native/mac/English.lproj/AtomWindow.xib +++ b/native/mac/English.lproj/AtomWindow.xib @@ -1,153 +1,153 @@ - - 1070 - 11E2620 - 2182 - 1138.47 - 569.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 2182 - - - NSWindowTemplate - NSView - NSCustomObject - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - AtomController - - - FirstResponder - - - Atom - - - 15 - 2 - {{180, 510}, {800, 800}} - 1613235200 - Window - UnderlayOpenGLHostingWindow - - - - - 256 - {800, 800} - - - - - {{0, 0}, {1440, 878}} - {10000000000000, 10000000000000} - 128 - NO - - - - - - - webView - - - - 6 - - - - window - - - - 7 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 1 - - - - - - - - 2 - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin - {{357, 418}, {480, 270}} - - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - 7 - - - - - UnderlayOpenGLHostingWindow - NSWindow - - IBProjectSource - ./Classes/UnderlayOpenGLHostingWindow.h - - - - - 0 - IBCocoaFramework - YES - 3 - YES - + + 1070 + 11E2620 + 2182 + 1138.47 + 569.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 2182 + + + NSWindowTemplate + NSView + NSCustomObject + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + AtomController + + + FirstResponder + + + Atom + + + 15 + 2 + {{180, 510}, {800, 800}} + 1613235200 + Window + UnderlayOpenGLHostingWindow + + + + + 256 + {800, 800} + + + + + {{0, 0}, {1440, 878}} + {10000000000000, 10000000000000} + 128 + NO + + + + + + + webView + + + + 6 + + + + window + + + + 7 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + + + + 2 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + {{357, 418}, {480, 270}} + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 7 + + + + + UnderlayOpenGLHostingWindow + NSWindow + + IBProjectSource + ./Classes/UnderlayOpenGLHostingWindow.h + + + + + 0 + IBCocoaFramework + YES + 3 + YES + diff --git a/native/mac/English.lproj/MainMenu.xib b/native/mac/English.lproj/MainMenu.xib index 17e6df6bd..2f81758ad 100644 --- a/native/mac/English.lproj/MainMenu.xib +++ b/native/mac/English.lproj/MainMenu.xib @@ -1,335 +1,335 @@ - - 1050 - 11E2620 - 2182 - 1138.47 - 569.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 2182 - - - YES - NSUserDefaultsController - NSMenu - NSMenuItem - NSCustomObject - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - ClientApplication - - - FirstResponder - - - AtomApplication - - - AMainMenu - - YES - - - Atom - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - Atom - - YES - - - Run Specs - s - 1835008 - 2147483647 - - - - - - Run Benchmarks - b - 1835008 - 2147483647 - - - - - - Quit - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - _NSMainMenu - - - YES - - - - - YES - - - delegate - - - - 440 - - - - runSpecs: - - - - 446 - - - - runBenchmarks: - - - - 447 - - - - terminate: - - - - 369 - - - - - YES - - 0 - - YES - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - YES - - - - MainMenu - - - 56 - - - YES - - - - - - 57 - - - YES - - - - - - - - 136 - - - 1111 - - - 389 - - - - - 442 - - - YES - - - - - 445 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 136.IBPluginDependency - 29.IBPluginDependency - 389.IBPluginDependency - 442.IBPluginDependency - 445.IBPluginDependency - 56.IBPluginDependency - 57.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - - - - YES - - - - - 447 - - - - YES - - AtomApplication - NSApplication - - YES - - YES - runBenchmarks: - runSpecs: - - - YES - id - id - - - - YES - - YES - runBenchmarks: - runSpecs: - - - YES - - runBenchmarks: - id - - - runSpecs: - id - - - - - IBProjectSource - ./Classes/AtomApplication.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - - - YES - {11, 11} - {10, 3} - - - + + 1050 + 11E2620 + 2182 + 1138.47 + 569.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 2182 + + + YES + NSUserDefaultsController + NSMenu + NSMenuItem + NSCustomObject + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + ClientApplication + + + FirstResponder + + + AtomApplication + + + AMainMenu + + YES + + + Atom + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + Atom + + YES + + + Run Specs + s + 1835008 + 2147483647 + + + + + + Run Benchmarks + b + 1835008 + 2147483647 + + + + + + Quit + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + _NSMainMenu + + + YES + + + + + YES + + + delegate + + + + 440 + + + + runSpecs: + + + + 446 + + + + runBenchmarks: + + + + 447 + + + + terminate: + + + + 369 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + MainMenu + + + 56 + + + YES + + + + + + 57 + + + YES + + + + + + + + 136 + + + 1111 + + + 389 + + + + + 442 + + + YES + + + + + 445 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 136.IBPluginDependency + 29.IBPluginDependency + 389.IBPluginDependency + 442.IBPluginDependency + 445.IBPluginDependency + 56.IBPluginDependency + 57.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 447 + + + + YES + + AtomApplication + NSApplication + + YES + + YES + runBenchmarks: + runSpecs: + + + YES + id + id + + + + YES + + YES + runBenchmarks: + runSpecs: + + + YES + + runBenchmarks: + id + + + runSpecs: + id + + + + + IBProjectSource + ./Classes/AtomApplication.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {11, 11} + {10, 3} + + + diff --git a/native/mac/helper-info.plist b/native/mac/helper-info.plist index 4805ce080..a90b9f27c 100644 --- a/native/mac/helper-info.plist +++ b/native/mac/helper-info.plist @@ -2,29 +2,29 @@ - CFBundleDevelopmentRegion - en - CFBundleDisplayName - ${EXECUTABLE_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - com.github.atom.helper - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - LSFileQuarantineEnabled - - LSMinimumSystemVersion - 10.5.0 - LSUIElement - 1 - NSSupportsAutomaticGraphicsSwitching - + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${EXECUTABLE_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.github.atom.helper + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + LSFileQuarantineEnabled + + LSMinimumSystemVersion + 10.5.0 + LSUIElement + 1 + NSSupportsAutomaticGraphicsSwitching + diff --git a/native/mac/info.plist b/native/mac/info.plist index 9dd8973e8..b21953721 100644 --- a/native/mac/info.plist +++ b/native/mac/info.plist @@ -2,27 +2,27 @@ - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - atom.icns - CFBundleIdentifier - com.github.atom - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - NSMainNibFile - MainMenu - NSPrincipalClass - AtomApp + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + atom.icns + CFBundleIdentifier + com.github.atom + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSMainNibFile + MainMenu + NSPrincipalClass + AtomApp diff --git a/native/v8_extensions/native.mm b/native/v8_extensions/native.mm index f75e60b7d..d8f1b8094 100644 --- a/native/v8_extensions/native.mm +++ b/native/v8_extensions/native.mm @@ -188,7 +188,7 @@ bool Native::Execute(const CefString& name, CefRefPtr callback = buttonNamesAndCallbacks->GetValue(buttonTag)->GetValue(1); CefV8ValueList args; - callback->SetRethrowExceptions(true); + callback->SetRethrowExceptions(true); callback->ExecuteFunction(callback, args); return true; diff --git a/native/v8_extensions/onig_reg_exp.mm b/native/v8_extensions/onig_reg_exp.mm index c271c5eaa..619f02624 100644 --- a/native/v8_extensions/onig_reg_exp.mm +++ b/native/v8_extensions/onig_reg_exp.mm @@ -112,7 +112,7 @@ bool OnigRegExp::Execute(const CefString& name, else if (name == "buildOnigRegExp") { CefRefPtr userData = new OnigRegExpUserData(arguments[0]); retval = CefV8Value::CreateObject(NULL); - retval->SetUserData(userData); + retval->SetUserData(userData); return true; } else if (name == "getCaptureCount") {