Skip to content

Commit 886d89d

Browse files
committed
Make it possible to build AeroSpace on macOS 14 + Xcode 16.2
1 parent 9314802 commit 886d89d

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ jobs:
1919
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
2020
# https://github.com/actions/runner-images/blob/main/images/macos/macos-15-arm64-Readme.md
2121
#
22-
# Xcode version comparison: https://en.wikipedia.org/wiki/Xcode
22+
# Xcode versions:
23+
# - https://en.wikipedia.org/wiki/Xcode
24+
# - https://xcodereleases.com/?scope=release
2325
os: [macos-13, macos-14, macos-15]
2426
name: Build
2527
runs-on: ${{ matrix.os }}

Sources/AppBundle/command/impl/CloseCommand.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct CloseCommand: Command {
1111
return io.err("Empty workspace")
1212
}
1313
// Access ax directly. Not cool :(
14-
if try await args.quitIfLastWindow.andAsyncMainActor(try await window.macAppUnsafe.getAxWindowsCount() == 1) {
14+
if try await args.quitIfLastWindow.andAsyncMainActor({ try await window.macAppUnsafe.getAxWindowsCount() == 1 }) {
1515
let app = window.macAppUnsafe
1616
if app.nsApp.terminate() {
1717
for workspace in Workspace.all {

Sources/AppBundle/mouse/moveWithMouse.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ private func moveWithMouseIfTheCase(_ window: Window) async throws { // todo cov
1818
if try await (window.isHiddenInCorner || // Don't allow to move windows of hidden workspaces
1919
!isLeftMouseButtonDown ||
2020
currentlyManipulatedWithMouseWindowId != nil && window.windowId != currentlyManipulatedWithMouseWindowId)
21-
.orAsyncMainActor(try await getNativeFocusedWindow() != window)
21+
.orAsyncMainActor({ try await getNativeFocusedWindow() != window })
2222
{
2323
return
2424
}

Sources/AppBundle/mouse/resizeWithMouse.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private func resizeWithMouseIfTheCase(_ window: Window) async throws { // todo c
3131
if try await (window.isHiddenInCorner || // Don't allow to resize windows of hidden workspaces
3232
!isLeftMouseButtonDown ||
3333
currentlyManipulatedWithMouseWindowId != nil && window.windowId != currentlyManipulatedWithMouseWindowId)
34-
.orAsyncMainActor(try await getNativeFocusedWindow() != window)
34+
.orAsyncMainActor({ try await getNativeFocusedWindow() != window })
3535
{
3636
return
3737
}

Sources/AppBundle/normalizeLayoutReason.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ private func validateStillPopups() async throws {
2323
private func _normalizeLayoutReason(workspace: Workspace, windows: [Window]) async throws {
2424
for window in windows {
2525
let isMacosFullscreen = try await window.isMacosFullscreen
26-
let isMacosMinimized = try await (!isMacosFullscreen).andAsyncMainActor(try await window.isMacosMinimized)
26+
let isMacosMinimized = try await (!isMacosFullscreen).andAsyncMainActor { try await window.isMacosMinimized }
2727
let isMacosWindowOfHiddenApp = !isMacosFullscreen && !isMacosMinimized &&
2828
!config.automaticallyUnhideMacosHiddenApps && window.macAppUnsafe.nsApp.isHidden
2929
switch window.layoutReason {

Sources/Common/util/BoolEx.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Foundation
55
// https://forums.swift.org/t/potential-false-positive-sending-risks-causing-data-races/78859
66
public extension Bool {
77
@inlinable
8-
func andAsync(isolation: isolated (any Actor)? = #isolation, _ rhs: @autoclosure () async throws -> Bool) async rethrows -> Bool {
8+
func andAsync(isolation: isolated (any Actor)? = #isolation, _ rhs: () async throws -> Bool) async rethrows -> Bool {
99
if self {
1010
return try await rhs()
1111
}
@@ -14,15 +14,15 @@ public extension Bool {
1414

1515
@inlinable
1616
@MainActor
17-
func andAsyncMainActor(_ rhs: @MainActor @Sendable @autoclosure () async throws -> Bool) async rethrows -> Bool {
17+
func andAsyncMainActor(_ rhs: @MainActor @Sendable () async throws -> Bool) async rethrows -> Bool {
1818
if self {
1919
return try await rhs()
2020
}
2121
return false
2222
}
2323

2424
@inlinable
25-
func orAsync(isolation: isolated (any Actor)? = #isolation, _ rhs: @autoclosure () async throws -> Bool) async rethrows -> Bool {
25+
func orAsync(isolation: isolated (any Actor)? = #isolation, _ rhs: () async throws -> Bool) async rethrows -> Bool {
2626
if self {
2727
return true
2828
}
@@ -31,7 +31,7 @@ public extension Bool {
3131

3232
@inlinable
3333
@MainActor
34-
func orAsyncMainActor(_ rhs: @MainActor @Sendable @autoclosure () async throws -> Bool) async rethrows -> Bool {
34+
func orAsyncMainActor(_ rhs: @MainActor @Sendable () async throws -> Bool) async rethrows -> Bool {
3535
if self {
3636
return true
3737
}

0 commit comments

Comments
 (0)