Skip to content

Commit 6c99112

Browse files
committed
fix: gate widget window transparency to Windows/Linux for macOS build
1 parent 10bd801 commit 6c99112

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎src-tauri/src/commands/widget_cmd.rs‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,12 +520,16 @@ pub fn build_widget_window_sync(app: &AppHandle, config: &WidgetConfig) -> Resul
520520
let (x, y) =
521521
compute_spawn_position(app, config.x, config.y, width, height, config.monitor_index);
522522

523-
WebviewWindowBuilder::new(app, &config.id, url)
523+
let builder = WebviewWindowBuilder::new(app, &config.id, url)
524524
.title(&format!("TimeLens - {}", config.widget_type))
525525
.inner_size(width, height)
526526
.position(x, y)
527-
.decorations(false)
528-
.transparent(true)
527+
.decorations(false);
528+
// `WebviewWindowBuilder::transparent` only exists on Windows and Linux;
529+
// macOS requires the private API feature, so widget windows stay opaque there.
530+
#[cfg(not(target_os = "macos"))]
531+
let builder = builder.transparent(true);
532+
builder
529533
.always_on_top(config.always_on_top_mode == "always")
530534
.skip_taskbar(false)
531535
.resizable(true)

0 commit comments

Comments
 (0)