-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No web content is displayed when vibrancy is applied. #48
Comments
I did some experiments: Given the empty window, if I drag the mouse through where the heading should be and right click, the menu prompts me to search for the text. If I remove this line, then the content is correctly displayed, but without vibrancy: Line 111 in f38bc23
It seems the issue stems from the vibrancy view covering the webkit view. I wonder if the latest version of tauri, or its creation of the webkit view for macOS 10.13.6 is special, which causes this plugin to add the subview first? |
can you try applying the effect in the |
I tried this, same result: fn main() {
let context = tauri::generate_context!();
tauri::Builder::default()
.menu(if cfg!(target_os = "macos") {
tauri::Menu::os_default(&context.package_info().name)
} else {
tauri::Menu::default()
})
.build(context)
.expect("error while running tauri application")
.run(|app_handle, event| match event {
tauri::RunEvent::Ready {} => {
let window = app_handle.get_window("main").unwrap();
#[cfg(target_os = "macos")]
apply_vibrancy(&window, NSVisualEffectMaterial::Sidebar)
.expect("Unsupported platform! 'apply_vibrancy' is only supported on macOS");
}
_ => {}
});
} |
I have the same issue I think. The WebView background is white. Even if I set it to transparent using CSS. Also I see a vibrancy for a split second when the window is showing. |
@alexgraddev if you're on macos: Did you enable the private apis? It's necessary for transparency, see: https://tauri.app/v1/api/config#tauriconfig.macosprivateapi |
@FabianLars, didn't know about it. Now it works. Thank you! P.S. I think it should be in the |
Is there a way it can check that and output a message to console if it isn't enabled? |
Yes that would be possible, but imo it should be enough that every transparency api doc mentions it, right? p.s. i guess adding it to the readme/example here is fair tho? idk |
I think the api doc for transparent is enough. This plugin shouldn't care how you enable transparency for your window. |
I don't think I'm experiencing the same issue as @alexgraddev did. I have set |
I had the same, just added this line to |
I enabled |
Edited the readme instructions mentioning these additional steps. #116 |
When I apply this plugin in macOS 10.13.6, I got an empty window with vibrancy applied:
If I remove the setup code, the content is correctly displayed:
I created the project with
npm create tauri-app
, and used the svelte framework. Any idea how to fix it?My configs:
src-tauri/src/main.rs
public/index.html
src-tauri/Cargo.toml
The text was updated successfully, but these errors were encountered: