From 1defe1a997b38356cdef694f19f10d78cf625e62 Mon Sep 17 00:00:00 2001 From: Lorenzo Zabot Date: Mon, 26 Feb 2024 17:53:24 +0100 Subject: [PATCH 1/9] Correct typos on sample config file (#1610) --- .amethyst.sample.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.amethyst.sample.yml b/.amethyst.sample.yml index 35843c58..e00406ac 100644 --- a/.amethyst.sample.yml +++ b/.amethyst.sample.yml @@ -1,9 +1,9 @@ -# Default settings for amethyst +# Default settings for Amethyst # Repo: `https://github.com/ianyh/Amethyst` # # Note due to issue 1419 (https://github.com/ianyh/Amethyst/issues/1419) some # config values may conflict and not work if they are the same as the default -# values for amathyst. You can see these values on github at +# values for Amethyst. You can see these values on GitHub at # https://github.com/ianyh/Amethyst/blob/development/Amethyst/default.amethyst # If you're experiencing conflicts and the settings are the same as the default, # comment out the commands in this file. @@ -235,7 +235,7 @@ relaunch-amethyst: # disable screen padding on builtin display disable-padding-on-builtin-display: false -# Boolean flag for whether or not to add margins betwen windows (default false). +# Boolean flag for whether or not to add margins between windows (default false). window-margins: false # Boolean flag for whether or not to set window margins if there is only one window on the screen, assuming window margins are enabled (default false). From f76bd92ccf2ff85f2c869303e62b0522a3cee07f Mon Sep 17 00:00:00 2001 From: Pere Bohigas Date: Wed, 28 Feb 2024 03:56:02 +0100 Subject: [PATCH 2/9] Replace `xcpretty` with `xcbeautify` (#1609) --- .github/workflows/tests.yml | 4 +++- .gitignore | 6 +++++- Brewfile | 5 +++++ Gemfile | 2 +- Gemfile.lock | 1 - 5 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 Brewfile diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fc17e363..fb1b3d28 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,6 +16,8 @@ jobs: - name: Dependencies run: | bundle install + brew bundle - name: Test run: | - set -o pipefail && xcodebuild -workspace Amethyst.xcworkspace -scheme Amethyst clean test | bundle exec xcpretty + set -o pipefail && xcodebuild -workspace Amethyst.xcworkspace -scheme Amethyst clean test | xcbeautify + diff --git a/.gitignore b/.gitignore index 261dcc48..e710a697 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,8 @@ crashlytics_app_key Carthage AMKeys.h fastlane/report.xml -*profraw \ No newline at end of file +*profraw + +# Homebrew +Brewfile.lock.json + diff --git a/Brewfile b/Brewfile new file mode 100644 index 00000000..bd8d28d5 --- /dev/null +++ b/Brewfile @@ -0,0 +1,5 @@ +# run 'brew bundle' to install all listed packages + +# Build tools +brew "xcbeautify" # Little beautifier tool for xcodebuild + diff --git a/Gemfile b/Gemfile index 9a7164ef..9544c345 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ source "https://rubygems.org" gem 'fastlane' -gem 'xcpretty' + diff --git a/Gemfile.lock b/Gemfile.lock index 7a7b41ab..c89e5588 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -213,7 +213,6 @@ PLATFORMS DEPENDENCIES fastlane - xcpretty BUNDLED WITH 2.2.33 From 1861c117a8f81d9234b9ade1d1107b90591eeb1a Mon Sep 17 00:00:00 2001 From: Pere Bohigas Date: Wed, 28 Feb 2024 17:22:53 +0100 Subject: [PATCH 3/9] Remove RubyGems (#1611) --- .github/workflows/tests.yml | 1 - .ruby-version | 1 - Brewfile | 1 + Gemfile | 4 - Gemfile.lock | 218 ------------------------------------ fastlane/README.md | 2 +- 6 files changed, 2 insertions(+), 225 deletions(-) delete mode 100644 .ruby-version delete mode 100644 Gemfile delete mode 100644 Gemfile.lock diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fb1b3d28..35da0cac 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,6 @@ jobs: uses: actions/checkout@v2 - name: Dependencies run: | - bundle install brew bundle - name: Test run: | diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index eca690e7..00000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -3.0.5 diff --git a/Brewfile b/Brewfile index bd8d28d5..9cfb86c5 100644 --- a/Brewfile +++ b/Brewfile @@ -1,5 +1,6 @@ # run 'brew bundle' to install all listed packages # Build tools +brew "fastlane" # Easiest way to build and release mobile apps brew "xcbeautify" # Little beautifier tool for xcodebuild diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 9544c345..00000000 --- a/Gemfile +++ /dev/null @@ -1,4 +0,0 @@ -source "https://rubygems.org" - -gem 'fastlane' - diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index c89e5588..00000000 --- a/Gemfile.lock +++ /dev/null @@ -1,218 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - CFPropertyList (3.0.6) - rexml - addressable (2.8.5) - public_suffix (>= 2.0.2, < 6.0) - artifactory (3.0.15) - atomos (0.1.3) - aws-eventstream (1.2.0) - aws-partitions (1.808.0) - aws-sdk-core (3.180.3) - aws-eventstream (~> 1, >= 1.0.2) - aws-partitions (~> 1, >= 1.651.0) - aws-sigv4 (~> 1.5) - jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.71.0) - aws-sdk-core (~> 3, >= 3.177.0) - aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.132.1) - aws-sdk-core (~> 3, >= 3.179.0) - aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.6) - aws-sigv4 (1.6.0) - aws-eventstream (~> 1, >= 1.0.2) - babosa (1.0.4) - claide (1.1.0) - colored (1.2) - colored2 (3.1.2) - commander (4.6.0) - highline (~> 2.0.0) - declarative (0.0.20) - digest-crc (0.6.5) - rake (>= 12.0.0, < 14.0.0) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) - dotenv (2.8.1) - emoji_regex (3.2.3) - excon (0.100.0) - faraday (1.10.3) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) - ruby2_keywords (>= 0.0.4) - faraday-cookie_jar (0.0.7) - faraday (>= 0.8.0) - http-cookie (~> 1.0.0) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-multipart (1.0.4) - multipart-post (~> 2) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) - faraday_middleware (1.2.0) - faraday (~> 1.0) - fastimage (2.2.7) - fastlane (2.214.0) - CFPropertyList (>= 2.3, < 4.0.0) - addressable (>= 2.8, < 3.0.0) - artifactory (~> 3.0) - aws-sdk-s3 (~> 1.0) - babosa (>= 1.0.3, < 2.0.0) - bundler (>= 1.12.0, < 3.0.0) - colored - commander (~> 4.6) - dotenv (>= 2.1.1, < 3.0.0) - emoji_regex (>= 0.1, < 4.0) - excon (>= 0.71.0, < 1.0.0) - faraday (~> 1.0) - faraday-cookie_jar (~> 0.0.6) - faraday_middleware (~> 1.0) - fastimage (>= 2.1.0, < 3.0.0) - gh_inspector (>= 1.1.2, < 2.0.0) - google-apis-androidpublisher_v3 (~> 0.3) - google-apis-playcustomapp_v1 (~> 0.1) - google-cloud-storage (~> 1.31) - highline (~> 2.0) - json (< 3.0.0) - jwt (>= 2.1.0, < 3) - mini_magick (>= 4.9.4, < 5.0.0) - multipart-post (>= 2.0.0, < 3.0.0) - naturally (~> 2.2) - optparse (~> 0.1.1) - plist (>= 3.1.0, < 4.0.0) - rubyzip (>= 2.0.0, < 3.0.0) - security (= 0.1.3) - simctl (~> 1.6.3) - terminal-notifier (>= 2.0.0, < 3.0.0) - terminal-table (>= 1.4.5, < 2.0.0) - tty-screen (>= 0.6.3, < 1.0.0) - tty-spinner (>= 0.8.0, < 1.0.0) - word_wrap (~> 1.0.0) - xcodeproj (>= 1.13.0, < 2.0.0) - xcpretty (~> 0.3.0) - xcpretty-travis-formatter (>= 0.0.3) - gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.48.0) - google-apis-core (>= 0.11.0, < 2.a) - google-apis-core (0.11.1) - addressable (~> 2.5, >= 2.5.1) - googleauth (>= 0.16.2, < 2.a) - httpclient (>= 2.8.1, < 3.a) - mini_mime (~> 1.0) - representable (~> 3.0) - retriable (>= 2.0, < 4.a) - rexml - webrick - google-apis-iamcredentials_v1 (0.17.0) - google-apis-core (>= 0.11.0, < 2.a) - google-apis-playcustomapp_v1 (0.13.0) - google-apis-core (>= 0.11.0, < 2.a) - google-apis-storage_v1 (0.19.0) - google-apis-core (>= 0.9.0, < 2.a) - google-cloud-core (1.6.0) - google-cloud-env (~> 1.0) - google-cloud-errors (~> 1.0) - google-cloud-env (1.6.0) - faraday (>= 0.17.3, < 3.0) - google-cloud-errors (1.3.1) - google-cloud-storage (1.44.0) - addressable (~> 2.8) - digest-crc (~> 0.4) - google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.19.0) - google-cloud-core (~> 1.6) - googleauth (>= 0.16.2, < 2.a) - mini_mime (~> 1.0) - googleauth (1.7.0) - faraday (>= 0.17.3, < 3.a) - jwt (>= 1.4, < 3.0) - memoist (~> 0.16) - multi_json (~> 1.11) - os (>= 0.9, < 2.0) - signet (>= 0.16, < 2.a) - highline (2.0.3) - http-cookie (1.0.5) - domain_name (~> 0.5) - httpclient (2.8.3) - jmespath (1.6.2) - json (2.6.3) - jwt (2.7.1) - memoist (0.16.2) - mini_magick (4.12.0) - mini_mime (1.1.5) - multi_json (1.15.0) - multipart-post (2.3.0) - nanaimo (0.3.0) - naturally (2.2.1) - optparse (0.1.1) - os (1.1.4) - plist (3.7.0) - public_suffix (5.0.3) - rake (13.0.6) - representable (3.2.0) - declarative (< 0.1.0) - trailblazer-option (>= 0.1.1, < 0.2.0) - uber (< 0.2.0) - retriable (3.1.2) - rexml (3.2.6) - rouge (2.0.7) - ruby2_keywords (0.0.5) - rubyzip (2.3.2) - security (0.1.3) - signet (0.17.0) - addressable (~> 2.8) - faraday (>= 0.17.5, < 3.a) - jwt (>= 1.5, < 3.0) - multi_json (~> 1.10) - simctl (1.6.10) - CFPropertyList - naturally - terminal-notifier (2.0.0) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) - trailblazer-option (0.1.2) - tty-cursor (0.7.1) - tty-screen (0.8.1) - tty-spinner (0.9.3) - tty-cursor (~> 0.7) - uber (0.1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.8.2) - unicode-display_width (1.8.0) - webrick (1.8.1) - word_wrap (1.0.0) - xcodeproj (1.22.0) - CFPropertyList (>= 2.3.3, < 4.0) - atomos (~> 0.1.3) - claide (>= 1.0.2, < 2.0) - colored2 (~> 3.1) - nanaimo (~> 0.3.0) - rexml (~> 3.2.4) - xcpretty (0.3.0) - rouge (~> 2.0.7) - xcpretty-travis-formatter (1.0.1) - xcpretty (~> 0.2, >= 0.0.7) - -PLATFORMS - ruby - -DEPENDENCIES - fastlane - -BUNDLED WITH - 2.2.33 diff --git a/fastlane/README.md b/fastlane/README.md index d975bdb3..af526d89 100644 --- a/fastlane/README.md +++ b/fastlane/README.md @@ -16,7 +16,7 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do ### mac ```sh -[bundle exec] fastlane mac +fastlane mac ``` From d465051454473de06460c7b0c5385ae9fb759612 Mon Sep 17 00:00:00 2001 From: Xiang Ji Date: Sun, 28 Apr 2024 13:47:51 +0200 Subject: [PATCH 4/9] Support a fifth screen (#1627) --- Amethyst/Events/HotKeyManager.swift | 4 ++-- Amethyst/default.amethyst | 8 ++++++++ AmethystTests/Tests/Managers/HotKeyManagerTests.swift | 2 +- README.md | 2 ++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Amethyst/Events/HotKeyManager.swift b/Amethyst/Events/HotKeyManager.swift index d9bf2cce..5cf9557c 100644 --- a/Amethyst/Events/HotKeyManager.swift +++ b/Amethyst/Events/HotKeyManager.swift @@ -198,7 +198,7 @@ class HotKeyManager: NSObject { } } - (1...4).forEach { screenNumber in + (1...5).forEach { screenNumber in let focusCommandKey = "\(CommandKey.focusScreenPrefix.rawValue)-\(screenNumber)" let throwCommandKey = "\(CommandKey.throwScreenPrefix.rawValue)-\(screenNumber)" @@ -392,7 +392,7 @@ class HotKeyManager: NSObject { hotKeyNameToDefaultsKey.append([name, "\(CommandKey.throwSpacePrefix.rawValue)-\(spaceNumber)"]) } - (1...4).forEach { screenNumber in + (1...5).forEach { screenNumber in let focusCommandName = "Focus screen \(screenNumber)" let throwCommandName = "Throw focused window to screen \(screenNumber)" let focusCommandKey = "\(CommandKey.focusScreenPrefix.rawValue)-\(screenNumber)" diff --git a/Amethyst/default.amethyst b/Amethyst/default.amethyst index ee0d878b..38123126 100644 --- a/Amethyst/default.amethyst +++ b/Amethyst/default.amethyst @@ -62,6 +62,10 @@ "mod": "mod1", "key": "q" }, + "focus-screen-5": { + "mod": "mod1", + "key": "g" + }, "throw-screen-1": { "mod": "mod2", "key": "w" @@ -78,6 +82,10 @@ "mod": "mod2", "key": "q" }, + "throw-screen-5": { + "mod": "mod2", + "key": "g" + }, "shrink-main": { "mod": "mod1", "key": "h" diff --git a/AmethystTests/Tests/Managers/HotKeyManagerTests.swift b/AmethystTests/Tests/Managers/HotKeyManagerTests.swift index d9764bca..95d8817e 100644 --- a/AmethystTests/Tests/Managers/HotKeyManagerTests.swift +++ b/AmethystTests/Tests/Managers/HotKeyManagerTests.swift @@ -17,7 +17,7 @@ class HotKeyManagerTests: QuickSpec { it("has the right number of screens") { let keyMapping = HotKeyManager.hotKeyNameToDefaultsKey() let screenCommands = keyMapping.filter { $0[1].hasPrefix(CommandKey.focusScreenPrefix.rawValue) } - expect(screenCommands.count).to(equal(6)) + expect(screenCommands.count).to(equal(7)) } } } diff --git a/README.md b/README.md index 04bd6604..e35f8aae 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,8 @@ And defines the following commands, mostly a mapping to xmonad key combinations. | `mod2 + r` | Throw focused window to screen 3 | | `mod1 + q` | Focus Screen 4 | | `mod2 + q` | Throw focused window to screen 4 | +| `mod1 + g` | Focus Screen 5 | +| `mod2 + g` | Throw focused window to screen 5 | | `mod1 + t` | Toggle float for focused window | | `mod1 + i` | Display current layout | | `mod2 + t` | Toggle global tiling | From 492fd68fefca00071ec022ce875e50e3e3eafb5b Mon Sep 17 00:00:00 2001 From: Ian Ynda-Hummel Date: Tue, 14 May 2024 06:48:52 -0400 Subject: [PATCH 5/9] Amethyst 0.21.0 (#1606) --- Amethyst.xcodeproj/project.pbxproj | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Amethyst.xcodeproj/project.pbxproj b/Amethyst.xcodeproj/project.pbxproj index 444d6f2d..be0ffa93 100644 --- a/Amethyst.xcodeproj/project.pbxproj +++ b/Amethyst.xcodeproj/project.pbxproj @@ -664,7 +664,6 @@ TargetAttributes = { 402DB6DD1742E41A00D1C936 = { LastSwiftMigration = 1010; - ProvisioningStyle = Automatic; }; 40D95B461C6E2ED800AAF433 = { CreatedOnToolsVersion = 7.2.1; @@ -1007,10 +1006,11 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Amethyst/AmethystDebug.entitlements; - CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 108; + CURRENT_PROJECT_VERSION = 110; DEAD_CODE_STRIPPING = YES; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; @@ -1030,7 +1030,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 0.20.0; + MARKETING_VERSION = 0.21.0; MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++14"; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"DEBUG\""; @@ -1049,10 +1049,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Amethyst/Amethyst.entitlements; - CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 108; + CURRENT_PROJECT_VERSION = 110; DEAD_CODE_STRIPPING = YES; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = 82P2XLB4UH; @@ -1072,7 +1072,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 0.20.0; + MARKETING_VERSION = 0.21.0; MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++14"; ONLY_ACTIVE_ARCH = NO; From cb2dc3c3edb022decbe2c539eb34b8ba5a143314 Mon Sep 17 00:00:00 2001 From: Jan Kremer <79042825+janurskremer@users.noreply.github.com> Date: Tue, 14 May 2024 19:02:56 +0200 Subject: [PATCH 6/9] Add new option to sample config (#1642) --- .amethyst.sample.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.amethyst.sample.yml b/.amethyst.sample.yml index e00406ac..50017318 100644 --- a/.amethyst.sample.yml +++ b/.amethyst.sample.yml @@ -266,6 +266,9 @@ floating-is-blacklist: true # true if screen frames should exclude the status bar. false if the screen frames should include the status bar (default false). ignore-menu-bar: false +# true if menu bar icon should be hidden (default false). +hide-menu-bar-icon: false + # true if windows smaller than a 500px square should be floating by default (default true) float-small-windows: true From 964c29dc2909a098db9f5c6976db7258bd3dded6 Mon Sep 17 00:00:00 2001 From: Ian Ynda-Hummel Date: Mon, 27 May 2024 20:18:44 -0400 Subject: [PATCH 7/9] Apply yabai's fix for moving windows between spaces in macOS 14.5 (#1648) --- .../xcshareddata/swiftpm/Package.resolved | 3 +- Amethyst/Model/Window.swift | 36 +++++++++++++++++-- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/Amethyst.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Amethyst.xcworkspace/xcshareddata/swiftpm/Package.resolved index 8acf1ea6..3d16718f 100644 --- a/Amethyst.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Amethyst.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,4 +1,5 @@ { + "originHash" : "43f1b1e9bfd866a37b073557f24d496c85ab3a7508ae523528cda0c3afb30aa9", "pins" : [ { "identity" : "cartography", @@ -127,5 +128,5 @@ } } ], - "version" : 2 + "version" : 3 } diff --git a/Amethyst/Model/Window.swift b/Amethyst/Model/Window.swift index 70a37f9a..fb019409 100644 --- a/Amethyst/Model/Window.swift +++ b/Amethyst/Model/Window.swift @@ -22,6 +22,12 @@ func SLPSPostEventRecordTo(_ psn: inout ProcessSerialNumber, _ bytes: inout UInt @_silgen_name("SLSMoveWindowsToManagedSpace") func SLSMoveWindowsToManagedSpace(_ cid: Int32, _ window_ids: CFArray, _ sid: Int) +@_silgen_name("SLSSpaceSetCompatID") +func SLSSpaceSetCompatID(_ cid: Int32, _ sid: Int, _ workspace: Int32) -> CGError + +@_silgen_name("SLSSetWindowListWorkspace") +func SLSSetWindowListWorkspace(_ cid: Int32, _ window_ids: UnsafePointer, _ window_count: Int32, _ workspace: Int32) -> CGError + let kCPSUserGenerated: UInt32 = 0x200 let kCPSNoWindows: UInt32 = 0x400 // swiftlint:enable identifier_name @@ -292,7 +298,7 @@ extension AXWindow: WindowType { What a mess. See: https://github.com/Hammerspoon/hammerspoon/issues/370#issuecomment-545545468 */ @discardableResult override func focus() -> Bool { - var pid = self.pid() + let pid = self.pid() var wid = self.cgID() var psn = ProcessSerialNumber() let status = GetProcessForPID(pid, &psn) @@ -367,6 +373,32 @@ extension AXWindow: WindowType { } func move(toSpace spaceID: CGSSpaceID) { - SLSMoveWindowsToManagedSpace(CGSMainConnectionID(), [cgID()] as CFArray, spaceID) + if ProcessInfo.processInfo.isOperatingSystemAtLeast(OperatingSystemVersion(majorVersion: 14, minorVersion: 5, patchVersion: 0)) { + /* + See: + - https://github.com/ianyh/Amethyst/issues/1643 + - https://github.com/koekeishiya/yabai/issues/2240 + - https://github.com/koekeishiya/yabai/commit/98bbdbd1363f27d35f09338cded0de1ec010d830 + */ + var error: CGError = .success + + error = SLSSpaceSetCompatID(CGSMainConnectionID(), spaceID, 0x79616265) + defer { _ = SLSSpaceSetCompatID(CGSMainConnectionID(), spaceID, 0x0) } + guard error == .success else { + log.error("failed to set compat aside id: \(error)") + return + } + + var id = cgID() + error = withUnsafeMutablePointer(to: &id, { pointer -> CGError in + return SLSSetWindowListWorkspace(CGSMainConnectionID(), pointer, 1, 0x79616265) + }) + guard error == .success else { + log.error("failed to throw window: \(error)") + return + } + } else { + SLSMoveWindowsToManagedSpace(CGSMainConnectionID(), [cgID()] as CFArray, spaceID) + } } } From 17843020f90b495b66172976b6fc5df9ed3d42c2 Mon Sep 17 00:00:00 2001 From: raven Date: Fri, 20 Sep 2024 09:45:35 +0900 Subject: [PATCH 8/9] Apply yabai's fix for moving windows between spaces in macOS 12, 13, and 15 (#1677) --- Amethyst/Model/Window.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Amethyst/Model/Window.swift b/Amethyst/Model/Window.swift index fb019409..cdb0cadd 100644 --- a/Amethyst/Model/Window.swift +++ b/Amethyst/Model/Window.swift @@ -373,12 +373,19 @@ extension AXWindow: WindowType { } func move(toSpace spaceID: CGSSpaceID) { - if ProcessInfo.processInfo.isOperatingSystemAtLeast(OperatingSystemVersion(majorVersion: 14, minorVersion: 5, patchVersion: 0)) { + let osVersion = ProcessInfo.processInfo.operatingSystemVersion + if ((osVersion.majorVersion >= 15) || + (osVersion.majorVersion == 14 && osVersion.minorVersion >= 5) || + (osVersion.majorVersion == 13 && osVersion.minorVersion >= 6) || + (osVersion.majorVersion == 12 && osVersion.minorVersion >= 7)){ /* See: - https://github.com/ianyh/Amethyst/issues/1643 + - https://github.com/ianyh/Amethyst/issues/1666 - https://github.com/koekeishiya/yabai/issues/2240 + - https://github.com/koekeishiya/yabai/issues/2408 - https://github.com/koekeishiya/yabai/commit/98bbdbd1363f27d35f09338cded0de1ec010d830 + - https://github.com/koekeishiya/yabai/commit/c8f913cbc0497d1dfe16138f40a8ba6ecaa744f8 */ var error: CGError = .success From c43f0ba57d1c9d703161377d5c90b24d194bc9d4 Mon Sep 17 00:00:00 2001 From: "C.Lee Taylor" Date: Fri, 20 Sep 2024 02:59:32 +0200 Subject: [PATCH 9/9] Update README.md with workspaces-auto-swoosh suggestion (#1664) --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index e35f8aae..867575b6 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,12 @@ Amethyst must be given permissions to use the accessibility APIs in the Privacy

+or run in a terminal: +```bash +defaults write com.apple.dock workspaces-auto-swoosh -bool NO +killall Dock +``` + Troubleshooting ===============