diff --git a/CHANGELOG.md b/CHANGELOG.md index 326ff24b..10f4349d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ Release: dd.mm.yyyy ### Bug Fixes -- Fix `Space#moveWindows` on Sonoma 14.5 ([#348](https://github.com/kasper/phoenix/issues/348), [#349](https://github.com/kasper/phoenix/issues/349)). +- Fix `Space#moveWindows` on macOS Sonoma (14.5) ([#348](https://github.com/kasper/phoenix/issues/348), [#349](https://github.com/kasper/phoenix/issues/349)). 4.0.0 ----- diff --git a/Phoenix/PHSpace.m b/Phoenix/PHSpace.m index 291cd3d7..c11d56a3 100644 --- a/Phoenix/PHSpace.m +++ b/Phoenix/PHSpace.m @@ -39,7 +39,8 @@ @implementation PHSpace static NSString *const CGSSpacesKey = @"Spaces"; // An arbitrary ID we can use with CGSSpaceSetCompatID -static const CGSMoveWindowCompatID PHMoveWindowsCompatId = 0x79616265; +static const CGSMoveWindowCompatID PHMoveWindowsCompatId = 4000; +static const CGSMoveWindowCompatID PHMoveWindowsResetCompatId = 0; // XXX: Undocumented private API to get the CGSConnectionID for the default connection for this process CGSConnectionID CGSMainConnectionID(void); @@ -237,8 +238,7 @@ - (void)removeWindows:(NSArray *)windows { (__bridge CFArrayRef) @[@(self.identifier)]); } -/** - * - https://github.com/kasper/phoenix/issues/348 +/* Fixes https://github.com/kasper/phoenix/issues/348, referencing: * - https://github.com/koekeishiya/yabai/issues/2240#issuecomment-2116326165 * - https://github.com/ianyh/Amethyst/issues/1643#issuecomment-2132519682 */ @@ -254,7 +254,7 @@ - (void)moveWindowsWithCompatId:(NSArray *)windows { CGSConnectionID connection = CGSMainConnectionID(); CGSSpaceSetCompatID(connection, self.identifier, PHMoveWindowsCompatId); CGSSetWindowListWorkspace(connection, (CGWindowID *)[windowIdSequence bytes], windowCount, PHMoveWindowsCompatId); - CGSSpaceSetCompatID(connection, self.identifier, 0x0); + CGSSpaceSetCompatID(connection, self.identifier, PHMoveWindowsResetCompatId); } - (void)moveWindows:(NSArray *)windows {