Skip to content

Commit

Permalink
Small cleanup for #350
Browse files Browse the repository at this point in the history
  • Loading branch information
kasper committed Jun 10, 2024
1 parent d922336 commit 1873b96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----
Expand Down
8 changes: 4 additions & 4 deletions Phoenix/PHSpace.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -237,8 +238,7 @@ - (void)removeWindows:(NSArray<PHWindow *> *)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
*/
Expand All @@ -254,7 +254,7 @@ - (void)moveWindowsWithCompatId:(NSArray<PHWindow *> *)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<PHWindow *> *)windows {
Expand Down

0 comments on commit 1873b96

Please sign in to comment.