diff options
| author | Brendan Allan <[email protected]> | 2026-01-21 22:35:05 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-21 08:35:05 -0600 |
| commit | d00b8df7707c0a4ad94ce7a3488780fe5764ae6c (patch) | |
| tree | f11e31b8cf95271711a4297ea09b54f6ce34dc1a /packages/desktop/src-tauri/src | |
| parent | 7ed448a7e8d8e1d2278086fe6dd2bd5b5e18e4f3 (diff) | |
| download | opencode-d00b8df7707c0a4ad94ce7a3488780fe5764ae6c.tar.gz opencode-d00b8df7707c0a4ad94ce7a3488780fe5764ae6c.zip | |
feat(desktop): properly integrate window controls on windows (#9835)
Diffstat (limited to 'packages/desktop/src-tauri/src')
| -rw-r--r-- | packages/desktop/src-tauri/src/lib.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/packages/desktop/src-tauri/src/lib.rs b/packages/desktop/src-tauri/src/lib.rs index 7b11397a3..aea730926 100644 --- a/packages/desktop/src-tauri/src/lib.rs +++ b/packages/desktop/src-tauri/src/lib.rs @@ -15,6 +15,8 @@ use std::{ time::{Duration, Instant}, }; use tauri::{AppHandle, LogicalSize, Manager, RunEvent, State, WebviewWindowBuilder}; +#[cfg(windows)] +use tauri_plugin_decorum::WebviewWindowExt; use tauri_plugin_dialog::{DialogExt, MessageDialogButtons, MessageDialogResult}; use tauri_plugin_shell::process::{CommandChild, CommandEvent}; use tauri_plugin_store::StoreExt; @@ -275,6 +277,7 @@ pub fn run() { .plugin(tauri_plugin_http::init()) .plugin(tauri_plugin_notification::init()) .plugin(PinchZoomDisablePlugin) + .plugin(tauri_plugin_decorum::init()) .invoke_handler(tauri::generate_handler![ kill_sidecar, install_cli, @@ -319,7 +322,13 @@ pub fn run() { .title_bar_style(tauri::TitleBarStyle::Overlay) .hidden_title(true); - let _window = window_builder.build().expect("Failed to create window"); + #[cfg(windows)] + let window_builder = window_builder.decorations(false); + + let window = window_builder.build().expect("Failed to create window"); + + #[cfg(windows)] + let _ = window.create_overlay_titlebar(); let (tx, rx) = oneshot::channel(); app.manage(ServerState::new(None, rx)); |
