Skip to content

Fix macOS transparent pet window#1

Merged
X-T-E-R merged 1 commit into
X-T-E-R:masterfrom
lin-coco:codex/fix-macos-transparent-window
May 5, 2026
Merged

Fix macOS transparent pet window#1
X-T-E-R merged 1 commit into
X-T-E-R:masterfrom
lin-coco:codex/fix-macos-transparent-window

Conversation

@lin-coco

@lin-coco lin-coco commented May 5, 2026

Copy link
Copy Markdown
Contributor

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 requires app.macOSPrivateApi plus the matching macos-private-api Cargo feature for transparent windows. Without those settings, the WebView is composited as an opaque white rectangle.

Changes

  • Enable app.macOSPrivateApi in src-tauri/tauri.conf.json.
  • Enable the macos-private-api feature on the tauri dependency in src-tauri/Cargo.toml.

A/B Test

The screenshots below are composited on a checkerboard background so the transparent pixels are visually obvious.

Before: transparent: true without macOSPrivateApi

Runtime output includes Tauri's warning that macos-private-api is not enabled. Window capture result: alphaMin=255, transparent pixels 0/402560, corners are opaque white [255,255,255,255].

before macOSPrivateApi disabled shows opaque white rectangle

After: macOSPrivateApi and macos-private-api enabled

Window capture result: alphaMin=0, transparent pixels 305811/402560, all four corners are transparent [0,0,0,0].

after macOSPrivateApi enabled shows checkerboard through transparent pixels

Validation

  • pnpm build
  • cargo check --manifest-path src-tauri/Cargo.toml

@lin-coco
lin-coco marked this pull request as ready for review May 5, 2026 08:10
@lin-coco lin-coco changed the title [codex] Fix macOS transparent pet window Fix macOS transparent pet window May 5, 2026
@X-T-E-R

X-T-E-R commented May 5, 2026

Copy link
Copy Markdown
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!

@X-T-E-R
X-T-E-R merged commit f5257bb into X-T-E-R:master May 5, 2026
@X-T-E-R

X-T-E-R commented May 5, 2026

Copy link
Copy Markdown
Owner

Merged — thanks again for the clear fix and validation details!

@X-T-E-R X-T-E-R added bug Something is not working as expected. area: runtime Desktop pet runtime, window behavior, tray, or local API. platform: macos macOS-specific behavior or packaging. labels May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Desktop pet runtime, window behavior, tray, or local API. bug Something is not working as expected. platform: macos macOS-specific behavior or packaging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants