From ed835fa6df704a662f549129c8788dce6a9c8208 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 2 Jul 2026 21:05:38 -0700 Subject: [PATCH] Support CEF runtime in window commands --- crates-tauri/yaak-app-client/src/lib.rs | 10 +++++----- crates-tauri/yaak-window/src/window.rs | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/crates-tauri/yaak-app-client/src/lib.rs b/crates-tauri/yaak-app-client/src/lib.rs index 8dfcfbb3..0484e375 100644 --- a/crates-tauri/yaak-app-client/src/lib.rs +++ b/crates-tauri/yaak-app-client/src/lib.rs @@ -183,7 +183,7 @@ struct AppMetaData { } #[tauri::command] -async fn cmd_metadata(app_handle: AppHandle) -> YaakResult { +async fn cmd_metadata(app_handle: AppHandle) -> YaakResult { let app_data_dir = app_handle.path().app_data_dir()?; let app_log_dir = app_handle.path().app_log_dir()?; let vendored_plugin_dir = @@ -968,7 +968,7 @@ async fn cmd_send_ephemeral_request( mut request: HttpRequest, environment_id: Option<&str>, cookie_jar_id: Option<&str>, - window: WebviewWindow, + window: WebviewWindow, app_handle: AppHandle, ) -> YaakResult { let response = HttpResponse::default(); @@ -1594,8 +1594,8 @@ async fn cmd_get_workspace_meta( } #[tauri::command] -async fn cmd_new_child_window( - parent_window: WebviewWindow, +async fn cmd_new_child_window( + parent_window: WebviewWindow, url: &str, label: &str, title: &str, @@ -1615,7 +1615,7 @@ async fn cmd_new_child_window( } #[tauri::command] -async fn cmd_new_main_window(app_handle: AppHandle, url: &str) -> YaakResult<()> { +async fn cmd_new_main_window(app_handle: AppHandle, url: &str) -> YaakResult<()> { let use_native_titlebar = app_handle.db().get_settings().use_native_titlebar; let win = yaak_window::window::create_main_window(&app_handle, url, use_native_titlebar)?; setup_window_menu(&win)?; diff --git a/crates-tauri/yaak-window/src/window.rs b/crates-tauri/yaak-window/src/window.rs index 950ed3c7..54aca202 100644 --- a/crates-tauri/yaak-window/src/window.rs +++ b/crates-tauri/yaak-window/src/window.rs @@ -119,11 +119,11 @@ pub fn create_window( Ok(win) } -pub fn create_main_window( - handle: &AppHandle, +pub fn create_main_window( + handle: &AppHandle, url: &str, use_native_titlebar: bool, -) -> tauri::Result { +) -> tauri::Result> { let mut counter = 0; let label = loop { let label = format!("{MAIN_WINDOW_PREFIX}{counter}"); @@ -152,14 +152,14 @@ pub fn create_main_window( create_window(handle, config) } -pub fn create_child_window( - parent_window: &WebviewWindow, +pub fn create_child_window( + parent_window: &WebviewWindow, url: &str, label: &str, title: &str, inner_size: (f64, f64), use_native_titlebar: bool, -) -> tauri::Result { +) -> tauri::Result> { let app_handle = parent_window.app_handle(); let label = format!("{OTHER_WINDOW_PREFIX}_{label}"); let scale_factor = parent_window.scale_factor()?;