Skip to content

feat(config): allow macOS fullscreen and transparent APIs to be enabled independently#15640

Open
tenderdeve wants to merge 2 commits into
tauri-apps:devfrom
tenderdeve:feat/15487-macos-private-api-split
Open

feat(config): allow macOS fullscreen and transparent APIs to be enabled independently#15640
tenderdeve wants to merge 2 commits into
tauri-apps:devfrom
tenderdeve:feat/15487-macos-private-api-split

Conversation

@tenderdeve

Copy link
Copy Markdown

Closes #15487

macOSPrivateApi currently couples two unrelated capabilities: it enables the WKWebView fullscreen API and transparent webview backgrounds. Apps that only need fullscreen are forced to also opt into the transparent-background private API. wry already exposes these as separate fullscreen / transparent features, so this splits them at the Tauri layer too.

Changes

  • New config options app > macOS > fullscreenApi and app > macOS > transparentBackgroundApi.
  • New Cargo features macos-private-api-fullscreen (→ wry/fullscreen) and macos-private-api-transparent (→ wry/transparent).
  • macOSPrivateApi kept as-is; it now enables both sub-features, so existing configs are unchanged.
  • AppConfig::features() emits only the sub-feature(s) the config actually needs.
  • Transparent-only cfg gates in tauri/tauri-runtime-wry retargeted to macos-private-api-transparent; fullscreen is compile-time via wry/fullscreen.
  • Regenerated config schema.

Testing

  • cargo test -p tauri-utils (config tests pass).
  • cargo check -p tauri -p tauri-runtime-wry under each of the three feature combinations.

@tenderdeve tenderdeve requested a review from a team as a code owner July 2, 2026 13:01

@velocitysystems velocitysystems left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @tenderdeve. I also know another contributor was looking into this. Any thoughts or feedback @polw1?

"default": {
"enableGTKAppId": false,
"macOS": {
"fullscreenApi": false,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend we match the naming of the crate feature flags:

  • privateApiFullscreen
  • privateApiTransparent

Prefixing them with privateApi* makes it immediately obvious the user is opting into a private API.

devtools = ["wry/devtools", "tauri-runtime/devtools"]
x11 = ["tao/x11", "wry/x11"]
macos-private-api-fullscreen = ["wry/fullscreen"]
macos-private-api-transparent = ["wry/transparent", "tauri-runtime/macos-private-api"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing about this feature mapping:

I understand this is technically fine today because this is in tauri-runtime, but at the same time, reading that the new transparent-only feature enables the old macos-private-api feature can feel a bit confusing at first.

It also means tauri-runtime/macos-private-api effectively has to keep meaning “transparent support”.

Maybe that tradeoff is perfectly fine if we do not expect more macOS private API gates in tauri-runtime.

But from an API design perspective, I wonder if it would be clearer to mirror the split in tauri-runtime too and keep the old feature as an alias:

macos-private-api = ["macos-private-api-transparent"]
macos-private-api-transparent = []

That would keep compatibility while making the mapping read more directly:

tauri/macos-private-api-transparent
-> tauri-runtime/macos-private-api-transparent
-> tauri-runtime-wry?/macos-private-api-transparent
-> wry/transparent

Not a blocker from my side, mostly a naming/design tradeoff that maintainers may have a better feel for

Comment thread crates/tauri/Cargo.toml
"tauri-utils/process-relaunch-dangerous-allow-symlink-macos",
]
macos-private-api = [
macos-private-api-fullscreen = ["tauri-runtime-wry?/macos-private-api-fullscreen"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also update the crate-level feature docs in crates/tauri/src/lib.rs?

The existing macos-private-api feature is documented there, but these two new public features (macos-private-api-fullscreen and macos-private-api-transparent) are not listed yet.

Since users can now enable them directly, it may be useful to document them next to the existing legacy macos-private-api entry so they show up clearly in the generated crate docs

…ed independently

Split the coupled `macOSPrivateApi` flag into `app > macOS > fullscreenApi`
and `app > macOS > transparentBackgroundApi`, backed by new
`macos-private-api-fullscreen` and `macos-private-api-transparent` Cargo
features. `macOSPrivateApi` stays as a compatibility alias enabling both.

Closes tauri-apps#15487
@tenderdeve

tenderdeve commented Jul 6, 2026

Copy link
Copy Markdown
Author

thanks for the review both

@polw1 added the docs for the two new features in fea51b2, sat them right next to the existing macos-private-api entry in lib.rs.

re mirroring the split into tauri-runtime - i left it on the umbrella name because tauri-runtime's own gates (window.rs / webview.rs) still cfg on macos-private-api, so making it read -transparent all the way down means renaming those cfg attrs too. don't mind doing that but since you said it's non-blocking / a maintainer-feel thing i'll leave that call to them rather than touch the runtime gates unprompted.

@velocitysystems the keys currently sit under app > macOS > { fullscreenApi, transparentBackgroundApi } and are documented as private-api opt-ins. can rename to privateApiFullscreen / privateApiTransparent no problem, just want a maintainer ok first since it's public config schema. will change it as soon as there's a thumbs up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] Allow transparent and fullScreenEnabled to be configured independently of macOSPrivateApi

3 participants