diff --git a/cli/tauri.js/templates/src-tauri/src/main.rs b/cli/tauri.js/templates/src-tauri/src/main.rs index 75d214733..2bbfc9b96 100755 --- a/cli/tauri.js/templates/src-tauri/src/main.rs +++ b/cli/tauri.js/templates/src-tauri/src/main.rs @@ -9,7 +9,7 @@ mod cmd; struct Context; fn main() { - tauri::AppBuilder::::new() + tauri::AppBuilder::::new() .invoke_handler(|_webview, arg| async move { use cmd::Cmd::*; match serde_json::from_str(&arg) { diff --git a/tauri/examples/api/src-tauri/src/main.rs b/tauri/examples/api/src-tauri/src/main.rs index 7006ad921..05a11a34a 100644 --- a/tauri/examples/api/src-tauri/src/main.rs +++ b/tauri/examples/api/src-tauri/src/main.rs @@ -16,7 +16,7 @@ struct Reply { struct Context; fn main() { - tauri::AppBuilder::::new() + tauri::AppBuilder::::new() .setup(|webview_manager| async move { let dispatcher = webview_manager.current_webview().await.unwrap(); let dispatcher_ = dispatcher.clone(); diff --git a/tauri/examples/helloworld/src-tauri/src/main.rs b/tauri/examples/helloworld/src-tauri/src/main.rs index ab25ae979..4d25e01e9 100644 --- a/tauri/examples/helloworld/src-tauri/src/main.rs +++ b/tauri/examples/helloworld/src-tauri/src/main.rs @@ -10,7 +10,7 @@ mod cmd; struct Context; fn main() { - tauri::AppBuilder::::new() + tauri::AppBuilder::::new() .invoke_handler(|_webview, arg| async move { use cmd::Cmd::*; match serde_json::from_str(&arg) { diff --git a/tauri/examples/multiwindow/src-tauri/src/main.rs b/tauri/examples/multiwindow/src-tauri/src/main.rs index a42baac84..221dad8f3 100644 --- a/tauri/examples/multiwindow/src-tauri/src/main.rs +++ b/tauri/examples/multiwindow/src-tauri/src/main.rs @@ -10,7 +10,7 @@ struct Context; use tauri::WebviewBuilderExt; fn main() { - tauri::AppBuilder::::new() + tauri::AppBuilder::::new() .setup(|webview_manager| async move { if webview_manager.current_window_label() == "Main" { webview_manager.listen("clicked", move |_| { diff --git a/tauri/src/app.rs b/tauri/src/app.rs index 83ddfdb79..39f1e065b 100644 --- a/tauri/src/app.rs +++ b/tauri/src/app.rs @@ -13,6 +13,7 @@ pub(crate) mod webview; mod webview_manager; pub use crate::api::config::WindowUrl; +use crate::flavors::Wry; pub use webview::{ wry::WryApplication, ApplicationDispatcherExt, ApplicationExt, Callback, CustomProtocol, Icon, Message, WebviewBuilderExt, @@ -189,7 +190,10 @@ impl WebviewInitializer for Arc> { /// The App builder. #[derive(Default)] -pub struct AppBuilder { +pub struct AppBuilder +where + A: ApplicationExt, +{ /// The JS message handler. invoke_handler: Option>>, /// The setup callback, invoked when the webview is ready. @@ -201,7 +205,7 @@ pub struct AppBuilder { webviews: Vec>, } -impl AppBuilder { +impl AppBuilder { /// Creates a new App builder. pub fn new() -> Self { Self { diff --git a/tauri/src/app/webview_manager.rs b/tauri/src/app/webview_manager.rs index cc0565bd4..a87282899 100644 --- a/tauri/src/app/webview_manager.rs +++ b/tauri/src/app/webview_manager.rs @@ -4,7 +4,7 @@ use super::{ App, ApplicationDispatcherExt, ApplicationExt, Icon, Webview, WebviewBuilderExt, WebviewInitializer, }; -use crate::{api::config::WindowUrl, async_runtime::Mutex}; +use crate::{api::config::WindowUrl, async_runtime::Mutex, flavors::Wry}; use serde::Serialize; @@ -170,7 +170,10 @@ impl WebviewDispatcher { } /// The webview manager. -pub struct WebviewManager { +pub struct WebviewManager +where + A: ApplicationExt, +{ application: Arc>, dispatchers: Arc>>>, current_webview_window_label: String,