From b28074afa76878a49f7cbf18235acfcadd713ab9 Mon Sep 17 00:00:00 2001 From: Tobias Bocanegra Date: Fri, 28 Aug 2015 00:07:20 -0700 Subject: [PATCH 1/4] @trivial add 'Resources' group so that plugin isntalation works --- .../project/__NON-CLI__.xcodeproj/project.pbxproj | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/templates/project/__NON-CLI__.xcodeproj/project.pbxproj b/bin/templates/project/__NON-CLI__.xcodeproj/project.pbxproj index c845475f..fd387d7b 100644 --- a/bin/templates/project/__NON-CLI__.xcodeproj/project.pbxproj +++ b/bin/templates/project/__NON-CLI__.xcodeproj/project.pbxproj @@ -109,9 +109,10 @@ children = ( 707060B018FFC0D900755D46 /* config.xml */, 70DAA8D91908785C00AF3749 /* www */, + 70BD682C18FFB02D00A1EFCF /* __PROJECT_NAME__ */, 70BD686818FFB0BF00A1EFCF /* Classes */, 7069FBC31905A1F9000B48E1 /* Plugins */, - 70BD682C18FFB02D00A1EFCF /* __PROJECT_NAME__ */, + 70D86C851B903D11000750E0 /* Resources */, 70BD682518FFB02D00A1EFCF /* Frameworks */, 70BD682418FFB02D00A1EFCF /* Products */, ); @@ -190,6 +191,13 @@ path = "__PROJECT_NAME__/Classes"; sourceTree = ""; }; + 70D86C851B903D11000750E0 /* Resources */ = { + isa = PBXGroup; + children = ( + ); + name = Resources; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ From d6ff0326983b046ff428e5ae8e2c83610e0e5836 Mon Sep 17 00:00:00 2001 From: Tobias Bocanegra Date: Sun, 30 Aug 2015 18:00:44 +0100 Subject: [PATCH 2/4] @trivial add 'Resources' group so that plugin isntalation works --- bin/templates/project/__NON-CLI__.xcodeproj/project.pbxproj | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/templates/project/__NON-CLI__.xcodeproj/project.pbxproj b/bin/templates/project/__NON-CLI__.xcodeproj/project.pbxproj index fd387d7b..f66e6e99 100644 --- a/bin/templates/project/__NON-CLI__.xcodeproj/project.pbxproj +++ b/bin/templates/project/__NON-CLI__.xcodeproj/project.pbxproj @@ -196,6 +196,7 @@ children = ( ); name = Resources; + path = "__PROJECT_NAME__/Resources"; sourceTree = ""; }; /* End PBXGroup section */ From 1d5d2e7ecd502bdaecf057c72a28cb53243497b6 Mon Sep 17 00:00:00 2001 From: Tobias Bocanegra Date: Sun, 30 Aug 2015 18:13:28 +0100 Subject: [PATCH 3/4] @trivial - disable codeisigning for deubug by default --- bin/templates/scripts/cordova/build-debug.xcconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/templates/scripts/cordova/build-debug.xcconfig b/bin/templates/scripts/cordova/build-debug.xcconfig index 2c8e63c8..fc5dade8 100644 --- a/bin/templates/scripts/cordova/build-debug.xcconfig +++ b/bin/templates/scripts/cordova/build-debug.xcconfig @@ -26,6 +26,6 @@ GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 // disable code signing for debug builds -// CODE_SIGNING_ALLOWED = NO +CODE_SIGNING_ALLOWED = NO #include "build-extras.xcconfig" From 5ec1cc4bd6709fda485c8b025fcdd9ef06ee0df8 Mon Sep 17 00:00:00 2001 From: Tobias Bocanegra Date: Sun, 30 Aug 2015 22:36:14 +0100 Subject: [PATCH 4/4] Fullscreen windows does not properly get focus - ensure that title less window can become key window - use black background while launching --- .../CordovaLib.xcodeproj/project.pbxproj | 8 ++++++ CordovaLib/CordovaLib/Classes/CDVMainWindow.h | 24 ++++++++++++++++ CordovaLib/CordovaLib/Classes/CDVMainWindow.m | 28 +++++++++++++++++++ .../CordovaLib/Classes/CDVViewController.m | 4 +++ .../__PROJECT_NAME__/MainViewController.xib | 2 +- 5 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 CordovaLib/CordovaLib/Classes/CDVMainWindow.h create mode 100644 CordovaLib/CordovaLib/Classes/CDVMainWindow.m diff --git a/CordovaLib/CordovaLib.xcodeproj/project.pbxproj b/CordovaLib/CordovaLib.xcodeproj/project.pbxproj index a087a66b..78f2e1f3 100644 --- a/CordovaLib/CordovaLib.xcodeproj/project.pbxproj +++ b/CordovaLib/CordovaLib.xcodeproj/project.pbxproj @@ -48,10 +48,12 @@ 70BD67BC18FFA12D00A1EFCF /* ShellUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD679618FFA12D00A1EFCF /* ShellUtils.m */; }; CC6A01B9AD6ECF2D913FF418 /* CDVWindowSizeCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = CC6A03B1971BACCB9183AEFE /* CDVWindowSizeCommand.h */; }; CC6A03130738A1F299369195 /* CDVCursorMonitorService.m in Sources */ = {isa = PBXBuildFile; fileRef = CC6A07666A2CE3AE46F85AD6 /* CDVCursorMonitorService.m */; }; + CC6A051516599A029D1ECA50 /* CDVMainWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CC6A0F82EDAFA619D95D3392 /* CDVMainWindow.m */; }; CC6A060DFE3B49803140B568 /* CDVCursorMonitorService.h in Headers */ = {isa = PBXBuildFile; fileRef = CC6A08BE679E9B2A17CB995E /* CDVCursorMonitorService.h */; }; CC6A061F0987401A5AB7FE69 /* NSScreen+Utils.h in Headers */ = {isa = PBXBuildFile; fileRef = CC6A00E23A9BC2910E28D36E /* NSScreen+Utils.h */; }; CC6A07EE3FA39E9ED21FC2AD /* CDVWindowSizeCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = CC6A0DB9905DAB3A94C6BCC8 /* CDVWindowSizeCommand.m */; }; CC6A0C2EAD9E57810677CE21 /* NSScreen+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = CC6A01EC9D87C6FC66791911 /* NSScreen+Utils.m */; }; + CC6A0EC955BC7E3B3BF31EA3 /* CDVMainWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = CC6A04379104F7E27DB88C08 /* CDVMainWindow.h */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -105,9 +107,11 @@ CC6A00E23A9BC2910E28D36E /* NSScreen+Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSScreen+Utils.h"; sourceTree = ""; }; CC6A01EC9D87C6FC66791911 /* NSScreen+Utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSScreen+Utils.m"; sourceTree = ""; }; CC6A03B1971BACCB9183AEFE /* CDVWindowSizeCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWindowSizeCommand.h; sourceTree = ""; }; + CC6A04379104F7E27DB88C08 /* CDVMainWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVMainWindow.h; sourceTree = ""; }; CC6A07666A2CE3AE46F85AD6 /* CDVCursorMonitorService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVCursorMonitorService.m; sourceTree = ""; }; CC6A08BE679E9B2A17CB995E /* CDVCursorMonitorService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCursorMonitorService.h; sourceTree = ""; }; CC6A0DB9905DAB3A94C6BCC8 /* CDVWindowSizeCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWindowSizeCommand.m; sourceTree = ""; }; + CC6A0F82EDAFA619D95D3392 /* CDVMainWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVMainWindow.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -189,6 +193,8 @@ 70BD677418FFA12D00A1EFCF /* CDVWebViewDelegate.m */, 70BD677518FFA12D00A1EFCF /* Commands */, 70BD679018FFA12D00A1EFCF /* Utils */, + CC6A04379104F7E27DB88C08 /* CDVMainWindow.h */, + CC6A0F82EDAFA619D95D3392 /* CDVMainWindow.m */, ); path = Classes; sourceTree = ""; @@ -276,6 +282,7 @@ CC6A01B9AD6ECF2D913FF418 /* CDVWindowSizeCommand.h in Headers */, CC6A061F0987401A5AB7FE69 /* NSScreen+Utils.h in Headers */, CC6A060DFE3B49803140B568 /* CDVCursorMonitorService.h in Headers */, + CC6A0EC955BC7E3B3BF31EA3 /* CDVMainWindow.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -351,6 +358,7 @@ CC6A07EE3FA39E9ED21FC2AD /* CDVWindowSizeCommand.m in Sources */, CC6A0C2EAD9E57810677CE21 /* NSScreen+Utils.m in Sources */, CC6A03130738A1F299369195 /* CDVCursorMonitorService.m in Sources */, + CC6A051516599A029D1ECA50 /* CDVMainWindow.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/CordovaLib/CordovaLib/Classes/CDVMainWindow.h b/CordovaLib/CordovaLib/Classes/CDVMainWindow.h new file mode 100644 index 00000000..229e0d12 --- /dev/null +++ b/CordovaLib/CordovaLib/Classes/CDVMainWindow.h @@ -0,0 +1,24 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#import + +@interface CDVMainWindow : NSWindow + +@end diff --git a/CordovaLib/CordovaLib/Classes/CDVMainWindow.m b/CordovaLib/CordovaLib/Classes/CDVMainWindow.m new file mode 100644 index 00000000..e26d8636 --- /dev/null +++ b/CordovaLib/CordovaLib/Classes/CDVMainWindow.m @@ -0,0 +1,28 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#import "CDVMainWindow.h" + +@implementation CDVMainWindow + +- (BOOL) canBecomeKeyWindow { + return YES; +} + +@end diff --git a/CordovaLib/CordovaLib/Classes/CDVViewController.m b/CordovaLib/CordovaLib/Classes/CDVViewController.m index cacc15fe..1d78e6c9 100644 --- a/CordovaLib/CordovaLib/Classes/CDVViewController.m +++ b/CordovaLib/CordovaLib/Classes/CDVViewController.m @@ -313,6 +313,10 @@ - (void) onAppDidFinishLaunching:(NSNotification*) notification { } else if (_cfgWindowSize.height > 0 && _cfgWindowSize.width > 0) { [CDVWindowSizeCommand setSizeOfWindow:self.window size:_cfgWindowSize]; } + // use black background while starting. + self.window.backgroundColor = [NSColor blackColor]; + self.webView.drawsBackground = NO; + [self showWindow:self]; [self.window makeKeyAndOrderFront:self]; [[NSApplication sharedApplication] activateIgnoringOtherApps : YES]; diff --git a/bin/templates/project/__PROJECT_NAME__/MainViewController.xib b/bin/templates/project/__PROJECT_NAME__/MainViewController.xib index 1d8d96f9..1db431af 100644 --- a/bin/templates/project/__PROJECT_NAME__/MainViewController.xib +++ b/bin/templates/project/__PROJECT_NAME__/MainViewController.xib @@ -84,7 +84,7 @@ - +