tauri
tauri copied to clipboard
[bug] windowconfig 'transparent' causes white screen on android, it should not do anything on android
Describe the bug
In V2, setting transparent to true in the WindowConfig will cause a white screen on android, this is not supposed to do anything on android.
Reproduction
- Make a new Tauri project using V2.
- Set transparent to true in WindowConfig.
- Run
tauri android dev
. (its the same when built) - You will see a white screen, if you turn transparent off and run dev again it will work.
Expected behavior
I expect Tauri to automatically turn transparent off on mobile devices.
Full tauri info
output
[✔] Environment
- OS: Windows 10.0.22631 X64
✔ WebView2: 123.0.2420.81
✔ MSVC: Visual Studio Community 2022
✔ rustc: 1.77.0 (aedd173a2 2024-03-17)
✔ cargo: 1.77.0 (3fe68eabf 2024-02-29)
✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
- node: 20.11.1
- pnpm: 8.15.6
- npm: 10.2.4
[-] Packages
- tauri [RUST]: 2.0.0-beta.13
- tauri-build [RUST]: 2.0.0-beta.10
- wry [RUST]: 0.37.0
- tao [RUST]: 0.26.2
- @tauri-apps/api [NPM]: 2.0.0-beta.6
- @tauri-apps/cli [NPM]: 2.0.0-beta.11
[-] App
- build-type: bundle
- CSP: unset
- frontendDist: ../dist
- devUrl: http://localhost:1420/
- framework: Vue.js
- bundler: Vite
Stack trace
No response
Additional context
simonhyll
in the Tauri discord server told me it was a bug and to make a bug report
same issue, and you can't use rust code window.transparent(true)
after window is built:
tauri::Builder::default()
.setup(|app| {
let get_window = app.get_webview_window("main").unwrap();
#[cfg(debug_assertions)]
{
get_window.open_devtools();
}
#[cfg(desktop)]
{
get_window.transparent(true);
}
Ok(())
})
which you would got:
error[E0599]: no method named `transparent` found for struct `tauri::WebviewWindow` in the current scope
--> src\lib.rs:20:28
|
20 | get_window.transparent(true);
| ^^^^^^^^^^^ method not found in `WebviewWindow`