Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ Rectangle uses [Swift Package Manager](https://www.swift.org/package-manager/) t

The original repository for MASShortcut was archived, so Rectangle uses my [fork](https://github.com/rxhanson/MASShortcut). If you want to make any changes that involve MASShortcut, please make a pull request on my fork.

Debug builds use the bundle identifier `com.knollsoft.Rectangle.debug`, so a build from Xcode gets its own Accessibility permission and preferences instead of sharing the installed copy's. Quit the installed Rectangle while running a Debug build, since both respond to the same shortcuts and window drags. Use the `.debug` identifier with `defaults` and `tccutil`. For example, an ad-hoc signed build needs its permission granted again after rebuilding, and `tccutil reset Accessibility com.knollsoft.Rectangle.debug` clears the stale entry.

Due to the addition of the Liquid Glass icon with a fallback for older versions of macOS, there will be a build failure on macOS versions < 26. You can delete the "Asset Catalog Other Flags" to build locally on versions < 26 (but don't check that change in if you create a pull request).

## Credits
Expand Down
2 changes: 1 addition & 1 deletion Rectangle.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@
);
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
MARKETING_VERSION = 2.0.3;
PRODUCT_BUNDLE_IDENTIFIER = com.knollsoft.Rectangle;
PRODUCT_BUNDLE_IDENTIFIER = com.knollsoft.Rectangle.debug;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down
2 changes: 0 additions & 2 deletions Rectangle/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import os.log
@main
class AppDelegate: NSObject, NSApplicationDelegate {

static let launcherAppId = "com.knollsoft.RectangleLauncher"

private let accessibilityAuthorization = AccessibilityAuthorization()
private let statusItem = RectangleStatusItem.instance
static let windowHistory = WindowHistory()
Expand Down
2 changes: 1 addition & 1 deletion Rectangle/ApplicationToggle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Cocoa
class ApplicationToggle: NSObject {

private var disabledApps = Set<String>()
public private(set) static var frontAppId: String? = "com.knollsoft.Rectangle"
public private(set) static var frontAppId: String? = Bundle.main.bundleIdentifier
public private(set) static var frontAppName: String? = "Rectangle"
public private(set) static var shortcutsDisabled: Bool = false

Expand Down
15 changes: 15 additions & 0 deletions RectangleTests/RectangleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1968,6 +1968,21 @@ class DefaultsExportTests: XCTestCase {
}
}

final class BundleIdentityTests: XCTestCase {

func testDebugBuildsUseTheirOwnBundleIdentifier() {
// Keeps a build from Xcode from sharing the installed app's
// Accessibility permission and preferences.
XCTAssertEqual(Bundle.main.bundleIdentifier, "com.knollsoft.Rectangle.debug")
}

func testExportedConfigKeepsTheReleaseBundleIdentifier() throws {
let json = try XCTUnwrap(Defaults.encoded())
let config = try XCTUnwrap(Defaults.convert(jsonString: json))
XCTAssertEqual(config.bundleId, "com.knollsoft.Rectangle")
}
}

class ConfigImportTests: XCTestCase {

private static let shortcutKeys = WindowAction.active.map(\.name) + TodoManager.defaultsKeys + StackBadgeManager.defaultsKeys
Expand Down
Loading