Fix macOS transparent pet window#1
Merged
X-T-E-R merged 1 commit intoMay 5, 2026
Merged
Conversation
lin-coco
marked this pull request as ready for review
May 5, 2026 08:10
Owner
|
Thanks for the contribution! This PR has a very clear summary, root-cause analysis, and validation notes. I’m running a local verification pass now, and if everything checks out I’ll get it merged. Thank you! |
Owner
|
Merged — thanks again for the clear fix and validation details! |
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
Fix the macOS pet window rendering with an opaque white background by enabling Tauri's macOS private API support for transparent windows.
Root Cause
The pet window is already configured with
transparent: true, and the pet spritesheet contains transparency. On macOS, Tauri also requiresapp.macOSPrivateApiplus the matchingmacos-private-apiCargo feature for transparent windows. Without those settings, the WebView is composited as an opaque white rectangle.Changes
app.macOSPrivateApiinsrc-tauri/tauri.conf.json.macos-private-apifeature on thetauridependency insrc-tauri/Cargo.toml.A/B Test
The screenshots below are composited on a checkerboard background so the transparent pixels are visually obvious.
Before:
transparent: truewithoutmacOSPrivateApiRuntime output includes Tauri's warning that
macos-private-apiis not enabled. Window capture result:alphaMin=255, transparent pixels0/402560, corners are opaque white[255,255,255,255].After:
macOSPrivateApiandmacos-private-apienabledWindow capture result:
alphaMin=0, transparent pixels305811/402560, all four corners are transparent[0,0,0,0].Validation
pnpm buildcargo check --manifest-path src-tauri/Cargo.toml