diff --git a/Rectangle/Defaults.swift b/Rectangle/Defaults.swift index 04ac7d84c..43cc267d6 100644 --- a/Rectangle/Defaults.swift +++ b/Rectangle/Defaults.swift @@ -16,6 +16,7 @@ class Defaults { static let subsequentExecutionMode = SubsequentExecutionDefault() static let allowAnyShortcut = BoolDefault(key: "allowAnyShortcut") static let windowSnapping = OptionalBoolDefault(key: "windowSnapping") + static let debug = BoolDefault(key: "debug") } class BoolDefault { diff --git a/Rectangle/WindowManager.swift b/Rectangle/WindowManager.swift index 52b78b254..80cec7c1e 100644 --- a/Rectangle/WindowManager.swift +++ b/Rectangle/WindowManager.swift @@ -7,6 +7,7 @@ // import Cocoa +import os.log class WindowManager { @@ -111,6 +112,10 @@ class WindowManager { rect: resultingRect, count: newCount ) + + if Defaults.debug.enabled { + os_log("%{PUBLIC}@ | display: %{PUBLIC}@, calculatedRect: %{PUBLIC}@, resultRect: %{PUBLIC}@", type: .debug, action.name, visibleFrameOfDestinationScreen.debugDescription, newNormalizedRect.debugDescription, resultingRect.debugDescription) + } } }