Skip to content

Commit f43c998

Browse files
echobtfactorydroid
andauthored
fix(gui): disable window transparency for consistent Windows behavior (#428)
On Windows, when decorations are disabled for custom titlebar support, setting transparent=true can cause issues with window hit-testing in production builds, making custom window control buttons (minimize, maximize, close) unresponsive or invisible. This change: - Sets transparent=false for all window types to match tauri.conf.json - Removes unused vibrancy/glassmorphism code from window creation - Ensures consistent window behavior between dev and production builds - Fixes titlebar buttons not working on Windows in production builds Co-authored-by: Droid Agent <droid@factory.ai>
1 parent 28ef4c8 commit f43c998

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

cortex-gui/src-tauri/src/window.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ fn create_window_internal(
252252
let mut builder = WebviewWindowBuilder::new(app, label, WebviewUrl::App(url.into()))
253253
.title("Cortex")
254254
.decorations(false)
255-
.transparent(true) // Enable for vibrancy/glassmorphism
255+
.transparent(false) // Disabled - matches tauri.conf.json for consistent Windows behavior
256256
.visible(false); // Hidden until frontend signals UI shell is ready
257257

258258
let is_max = if let Some(b) = bounds {
@@ -312,14 +312,11 @@ pub async fn create_new_window(app: AppHandle, path: Option<String>) -> Result<(
312312
.title("Cortex")
313313
.inner_size(1200.0, 800.0)
314314
.decorations(false) // Custom title bar is used
315-
.transparent(true) // Enable for vibrancy/glassmorphism
315+
.transparent(false) // Disabled - matches tauri.conf.json for consistent Windows behavior
316316
.visible(false) // Hidden until frontend signals UI shell is ready
317317
.build()
318318
.map_err(|e| format!("Failed to create window: {}", e))?;
319319

320-
// Apply vibrancy effect for glassmorphism
321-
apply_window_vibrancy(&window);
322-
323320
// Fallback: show window after 3 seconds if frontend hasn't signaled ready
324321
// This prevents invisible windows if frontend fails to load
325322
let window_clone = window.clone();
@@ -371,14 +368,14 @@ pub async fn create_auxiliary_window(
371368
let window = WebviewWindowBuilder::new(&app, label, WebviewUrl::App(url.into()))
372369
.title(title)
373370
.inner_size(width, height)
374-
.decorations(true)
375-
.transparent(true) // Enable for vibrancy/glassmorphism
371+
.decorations(true) // Auxiliary windows use native decorations
372+
.transparent(false) // Consistent with main windows
376373
.visible(false) // Hidden until frontend signals UI shell is ready
377374
.build()
378375
.map_err(|e| format!("Failed to create auxiliary window: {}", e))?;
379376

380-
// Apply vibrancy effect for glassmorphism
381-
apply_window_vibrancy(&window);
377+
// Show the auxiliary window (has decorations, no need to wait for custom titlebar)
378+
let _ = window.show();
382379

383380
Ok(())
384381
}

0 commit comments

Comments
 (0)