Skip to content

Commit 8a65111

Browse files
committed
fix(desktop): properly scope macOS conditional compilation
The previous fix incorrectly removed braces around the macOS-specific window configuration, causing #[cfg(target_os = "macos")] to only apply to the let binding. This would have caused the title bar style and hidden title settings to be applied on all platforms. This commit: - Restores the braces to properly scope the conditional block - Adds #[allow(unused_mut)] to suppress the warning since window_builder is only mutated on macOS Fixes review feedback on PR #7707
1 parent 2005b39 commit 8a65111

File tree

1 file changed

+7
-4
lines changed
  • packages/desktop/src-tauri/src

1 file changed

+7
-4
lines changed

packages/desktop/src-tauri/src/lib.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ pub fn run() {
302302
.unwrap_or(LogicalSize::new(1920, 1080));
303303

304304
// Create window immediately with serverReady = false
305-
let window_builder =
305+
#[allow(unused_mut)]
306+
let mut window_builder =
306307
WebviewWindow::builder(&app, "main", WebviewUrl::App("/".into()))
307308
.title("OpenCode")
308309
.inner_size(size.width as f64, size.height as f64)
@@ -318,9 +319,11 @@ pub fn run() {
318319
));
319320

320321
#[cfg(target_os = "macos")]
321-
let window_builder = window_builder
322-
.title_bar_style(tauri::TitleBarStyle::Overlay)
323-
.hidden_title(true);
322+
{
323+
window_builder = window_builder
324+
.title_bar_style(tauri::TitleBarStyle::Overlay)
325+
.hidden_title(true);
326+
}
324327

325328
let window = window_builder.build().expect("Failed to create window");
326329

0 commit comments

Comments
 (0)