diff --git a/Sharkle.xcodeproj/project.pbxproj b/Sharkle.xcodeproj/project.pbxproj index 2d1593c..b98b5bd 100644 --- a/Sharkle.xcodeproj/project.pbxproj +++ b/Sharkle.xcodeproj/project.pbxproj @@ -151,10 +151,12 @@ TargetAttributes = { 5687554F1EA82781004C351F = { CreatedOnToolsVersion = 8.3.2; - DevelopmentTeam = 4YJ6956B5Q; LastSwiftMigration = 0900; ProvisioningStyle = Automatic; SystemCapabilities = { + com.apple.HardenedRuntime = { + enabled = 1; + }; com.apple.Sandbox = { enabled = 0; }; @@ -342,8 +344,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Sharkle/Sharkle.entitlements; + CODE_SIGN_IDENTITY = "Mac Developer"; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = 4YJ6956B5Q; + DEVELOPMENT_TEAM = 4254J4CMHQ; + ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = Sharkle/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.13; @@ -362,8 +366,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Sharkle/Sharkle.entitlements; + CODE_SIGN_IDENTITY = "Mac Developer"; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = 4YJ6956B5Q; + DEVELOPMENT_TEAM = 4254J4CMHQ; + ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = Sharkle/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.13; diff --git a/Sharkle.xcodeproj/project.xcworkspace/xcuserdata/peterwunder.xcuserdatad/UserInterfaceState.xcuserstate b/Sharkle.xcodeproj/project.xcworkspace/xcuserdata/peterwunder.xcuserdatad/UserInterfaceState.xcuserstate index d6ea432..8fad0fc 100644 Binary files a/Sharkle.xcodeproj/project.xcworkspace/xcuserdata/peterwunder.xcuserdatad/UserInterfaceState.xcuserstate and b/Sharkle.xcodeproj/project.xcworkspace/xcuserdata/peterwunder.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Sharkle/AppDelegate.swift b/Sharkle/AppDelegate.swift index bef5c4a..a2dec51 100644 --- a/Sharkle/AppDelegate.swift +++ b/Sharkle/AppDelegate.swift @@ -10,10 +10,18 @@ import Cocoa @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { + + weak var sharkleController: SharkleWindowController! func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + @IBAction func resetSharklePosition(_ sender: NSMenuItem) { + if let window = self.sharkleController.window { + window.setFrameOrigin(NSPoint(x: 24, y: 24)) + } + } + } diff --git a/Sharkle/Base.lproj/Main.storyboard b/Sharkle/Base.lproj/Main.storyboard index 076c88f..df9ca29 100644 --- a/Sharkle/Base.lproj/Main.storyboard +++ b/Sharkle/Base.lproj/Main.storyboard @@ -1,8 +1,8 @@ - + - + @@ -84,6 +84,13 @@ + + + + + + + @@ -115,7 +122,7 @@ - + @@ -124,7 +131,7 @@ - + @@ -352,7 +359,7 @@ For a relatively spoiler-free explanation, watch this part of Jesse Cox's playth - + diff --git a/Sharkle/Info.plist b/Sharkle/Info.plist index d63bcd4..c0b880b 100644 --- a/Sharkle/Info.plist +++ b/Sharkle/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.1 + 1.2 CFBundleVersion 1 LSApplicationCategoryType diff --git a/Sharkle/SharkleWindowController.swift b/Sharkle/SharkleWindowController.swift index 1d7b5ed..f477450 100644 --- a/Sharkle/SharkleWindowController.swift +++ b/Sharkle/SharkleWindowController.swift @@ -12,11 +12,13 @@ class SharkleWindowController: NSWindowController { override func windowDidLoad() { super.windowDidLoad() + + (NSApplication.shared.delegate as! AppDelegate).sharkleController = self // Yes, I'm taking a valid value returned by the system and arbitrarily adding one to it. Sue me. // This is the only way to make Sharkle able to intercept clicks. self.window?.level = NSWindow.Level(rawValue: Int(CGWindowLevelForKey(CGWindowLevelKey.desktopIconWindow)) + 1) - + // Make window movable by its background, durr self.window?.isMovableByWindowBackground = true