Fix fullscreen Space detection reading the wrong Space type - #10
Merged
Merged
Conversation
CGSSpaceGetType returns a raw uint32_t, but its Swift declaration returned the CGSSpaceType enum. Swift reads the returned integer as the enum's case tag, not its raw value, so isSpaceFullscreen reported a system Space (raw type 2) as fullscreen and a real fullscreen Space (raw type 4) as not. Declare the function as returning UInt32 and compare with the raw value. The fix was found in jordanbaird#980. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideFixes fullscreen Space detection by matching the native Sequence diagram for corrected fullscreen Space detectionsequenceDiagram
participant AppState
participant Bridging
participant CGS
AppState->>Bridging: isSpaceFullscreen(spaceID)
Bridging->>CGS: CGSSpaceGetType(connectionID, spaceID)
CGS-->>Bridging: UInt32 spaceType
Bridging-->>AppState: spaceType == CGSSpaceType.fullscreen.rawValue
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
cavaldos
added a commit
that referenced
this pull request
Sep 17, 2026
cavaldos
added a commit
that referenced
this pull request
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes fullscreen Space detection.
Bridging.isSpaceFullscreencurrently reports ordinary system Spaces as fullscreen and real fullscreen Spaces as not fullscreen.Cause
CGSSpaceGetTypeis a C function that returns a rawuint32_t(0 user, 2 system, 4 fullscreen). Its Swift shim declared the return type as theCGSSpaceTypeenum. Swift doesn't convert the value throughinit(rawValue:)there; it reads the integer as the enum's case tag. As a result:isSpaceFullscreenThat feeds
AppState.isActiveSpaceFullscreen, so anything keyed on fullscreen, such as the menu bar appearance overlays, behaves backwards.Change
CGSSpaceGetTypeas returningUInt32.CGSSpaceType.fullscreen.rawValue.The fix comes from jordanbaird#980.
Testing
mainwith this change using Xcode 27.0 on macOS 27.0 (26A428).🤖 Generated with Claude Code
Summary by Sourcery
Bug Fixes: