From 1dde0f0bdab32671687e34c32a6d062b9dec0311 Mon Sep 17 00:00:00 2001 From: Ryan Hanson Date: Sat, 23 Nov 2019 09:58:48 +0100 Subject: [PATCH] Set target OS to 10.11 --- Rectangle.xcodeproj/project.pbxproj | 36 +++++++++---------- Rectangle/AccessibilityElement.swift | 16 ++++++--- Rectangle/WindowManager.swift | 4 ++- .../RectangleLauncher.entitlements | 5 ++- 4 files changed, 37 insertions(+), 24 deletions(-) diff --git a/Rectangle.xcodeproj/project.pbxproj b/Rectangle.xcodeproj/project.pbxproj index e6c40ca8e..b2ed7c0f1 100644 --- a/Rectangle.xcodeproj/project.pbxproj +++ b/Rectangle.xcodeproj/project.pbxproj @@ -793,17 +793,17 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = RectangleLauncher/RectangleLauncher.entitlements; - CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = XSYZ3E4B7D; - ENABLE_HARDENED_RUNTIME = NO; + ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = RectangleLauncher/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.12; + MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = com.knollsoft.RectangleLauncher; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -818,17 +818,17 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = RectangleLauncher/RectangleLauncher.entitlements; - CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = XSYZ3E4B7D; - ENABLE_HARDENED_RUNTIME = NO; + ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = RectangleLauncher/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.12; + MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = com.knollsoft.RectangleLauncher; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -889,7 +889,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.12; + MACOSX_DEPLOYMENT_TARGET = 10.11; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -945,7 +945,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.12; + MACOSX_DEPLOYMENT_TARGET = 10.11; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = macosx; @@ -960,19 +960,19 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Rectangle/Rectangle.entitlements; - CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 14; + CURRENT_PROJECT_VERSION = 15; DEVELOPMENT_TEAM = XSYZ3E4B7D; - ENABLE_HARDENED_RUNTIME = NO; + ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = Rectangle/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.12; - MARKETING_VERSION = 0.10; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MARKETING_VERSION = 0.10.1; PRODUCT_BUNDLE_IDENTIFIER = com.knollsoft.Rectangle; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -986,19 +986,19 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Rectangle/Rectangle.entitlements; - CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 14; + CURRENT_PROJECT_VERSION = 15; DEVELOPMENT_TEAM = XSYZ3E4B7D; - ENABLE_HARDENED_RUNTIME = NO; + ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = Rectangle/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.12; - MARKETING_VERSION = 0.10; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MARKETING_VERSION = 0.10.1; PRODUCT_BUNDLE_IDENTIFIER = com.knollsoft.Rectangle; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/Rectangle/AccessibilityElement.swift b/Rectangle/AccessibilityElement.swift index dc9688b75..e4e1713d0 100644 --- a/Rectangle/AccessibilityElement.swift +++ b/Rectangle/AccessibilityElement.swift @@ -27,7 +27,9 @@ class AccessibilityElement { static func frontmostWindow() -> AccessibilityElement? { guard let frontmostApplicationElement = AccessibilityElement.frontmostApplication() else { - os_log("Failed to find the application that currently has focus.", type: .info) + if #available(OSX 10.12, *) { + os_log("Failed to find the application that currently has focus.", type: .info) + } return nil } let focusedAttr = NSAccessibility.Attribute.focusedWindow as CFString @@ -42,7 +44,9 @@ class AccessibilityElement { return AccessibilityElement(copiedUnderlyingElement as! AXUIElement) } } - os_log("Unable to obtain accessibility element", type: .debug) + if #available(OSX 10.12, *) { + os_log("Unable to obtain accessibility element", type: .debug) + } return nil } @@ -118,7 +122,9 @@ class AccessibilityElement { if let value = AXValue.from(value: position, type: .cgPoint) { AXUIElementSetAttributeValue(self.underlyingElement, kAXPositionAttribute as CFString, value) if Defaults.debug.enabled { - os_log("AX position proposed: %{public}@, result: %{public}@", type: .debug, position.debugDescription, getPosition()?.debugDescription ?? "N/A") + if #available(OSX 10.12, *) { + os_log("AX position proposed: %{public}@, result: %{public}@", type: .debug, position.debugDescription, getPosition()?.debugDescription ?? "N/A") + } } } } @@ -131,7 +137,9 @@ class AccessibilityElement { if let value = AXValue.from(value: size, type: .cgSize) { AXUIElementSetAttributeValue(self.underlyingElement, kAXSizeAttribute as CFString, value) if Defaults.debug.enabled { - os_log("AX sizing proposed: %{public}@, result: %{public}@", type: .debug, size.debugDescription, getSize()?.debugDescription ?? "N/A") + if #available(OSX 10.12, *) { + os_log("AX sizing proposed: %{public}@, result: %{public}@", type: .debug, size.debugDescription, getSize()?.debugDescription ?? "N/A") + } } } } diff --git a/Rectangle/WindowManager.swift b/Rectangle/WindowManager.swift index b6746bfe3..abc6a7587 100644 --- a/Rectangle/WindowManager.swift +++ b/Rectangle/WindowManager.swift @@ -114,7 +114,9 @@ class WindowManager { ) if Defaults.debug.enabled { - os_log("%{public}@ | display: %{public}@, calculatedRect: %{public}@, resultRect: %{public}@", type: .debug, action.name, visibleFrameOfDestinationScreen.debugDescription, newNormalizedRect.debugDescription, resultingRect.debugDescription) + if #available(OSX 10.12, *) { + os_log("%{public}@ | display: %{public}@, calculatedRect: %{public}@, resultRect: %{public}@", type: .debug, action.name, visibleFrameOfDestinationScreen.debugDescription, newNormalizedRect.debugDescription, resultingRect.debugDescription) + } } } } diff --git a/RectangleLauncher/RectangleLauncher.entitlements b/RectangleLauncher/RectangleLauncher.entitlements index 0c67376eb..852fa1a47 100644 --- a/RectangleLauncher/RectangleLauncher.entitlements +++ b/RectangleLauncher/RectangleLauncher.entitlements @@ -1,5 +1,8 @@ - + + com.apple.security.app-sandbox + +