From 533fcad647354530f2cdd28e2687939bc896a8da Mon Sep 17 00:00:00 2001 From: Tomas Dvorak Date: Sat, 19 Sep 2026 11:39:46 +0200 Subject: [PATCH] fix(desktop): create windows transparent at build time for Mica effects PR#50 called WebviewWindow::set_transparent, which does not exist in Tauri 2.11 (Tauri 1 API). Moved .transparent(true) onto the two window builders under cfg(windows); set_effects is stable and stays post-build. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- desktop/src-tauri/src/commands.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/desktop/src-tauri/src/commands.rs b/desktop/src-tauri/src/commands.rs index 33391cac..f05fbfaf 100644 --- a/desktop/src-tauri/src/commands.rs +++ b/desktop/src-tauri/src/commands.rs @@ -722,6 +722,11 @@ fn show_drive_window_internal(app: &AppHandle, title: &str, url_path: &str) { // avoid platform compositor artifacts while preserving Windows effects. let builder = builder.background_color(Color(255, 255, 255, 255)); + // Windows Mica/Acrylic effects require the window to be created transparent + // (WebviewWindow has no post-build transparency switch in Tauri 2). + #[cfg(windows)] + let builder = builder.transparent(true); + // Platform-specific: title_bar_style and hidden_title are macOS-only #[cfg(target_os = "macos")] let builder = builder @@ -739,7 +744,6 @@ fn show_drive_window_internal(app: &AppHandle, title: &str, url_path: &str) { #[cfg(windows)] { - let _ = window.set_transparent(true); let _ = window.set_effects(effects); } @@ -803,6 +807,11 @@ pub fn show_settings_window_impl(app: &AppHandle) { // avoid platform compositor artifacts while preserving Windows effects. let builder = builder.background_color(Color(255, 255, 255, 255)); + // Windows Mica/Acrylic effects require the window to be created transparent + // (WebviewWindow has no post-build transparency switch in Tauri 2). + #[cfg(windows)] + let builder = builder.transparent(true); + // Platform-specific: title_bar_style and hidden_title are macOS-only #[cfg(target_os = "macos")] let builder = builder @@ -820,7 +829,6 @@ pub fn show_settings_window_impl(app: &AppHandle) { #[cfg(windows)] { - let _ = window.set_transparent(true); let _ = window.set_effects(effects); }