diff --git a/plugins/window/src/desktop_commands.rs b/plugins/window/src/desktop_commands.rs index 63ef037b..bb38c82b 100644 --- a/plugins/window/src/desktop_commands.rs +++ b/plugins/window/src/desktop_commands.rs @@ -58,7 +58,7 @@ impl From for Icon { } #[tauri::command] -pub fn create(app: AppHandle, options: WindowConfig) -> Result<()> { +pub async fn create(app: AppHandle, options: WindowConfig) -> Result<()> { tauri::window::WindowBuilder::from_config(&app, options).build()?; Ok(()) } @@ -73,7 +73,7 @@ fn get_window(window: Window, label: Option) -> Result { #[tauri::command] - pub fn $cmd(window: Window, label: Option) -> Result<$ret> { + pub async fn $cmd(window: Window, label: Option) -> Result<$ret> { get_window(window, label)?.$cmd().map_err(Into::into) } }; @@ -82,14 +82,14 @@ macro_rules! getter { macro_rules! setter { ($cmd: ident) => { #[tauri::command] - pub fn $cmd(window: Window, label: Option) -> Result<()> { + pub async fn $cmd(window: Window, label: Option) -> Result<()> { get_window(window, label)?.$cmd().map_err(Into::into) } }; ($cmd: ident, $input: ty) => { #[tauri::command] - pub fn $cmd( + pub async fn $cmd( window: Window, label: Option, value: $input, @@ -147,7 +147,7 @@ setter!(start_dragging); setter!(print); #[tauri::command] -pub fn set_icon( +pub async fn set_icon( window: Window, label: Option, value: IconDto, @@ -158,7 +158,7 @@ pub fn set_icon( } #[tauri::command] -pub fn toggle_maximize(window: Window, label: Option) -> Result<()> { +pub async fn toggle_maximize(window: Window, label: Option) -> Result<()> { let window = get_window(window, label)?; match window.is_maximized()? { true => window.unmaximize()?, @@ -168,7 +168,7 @@ pub fn toggle_maximize(window: Window, label: Option) -> } #[tauri::command] -pub fn internal_toggle_maximize( +pub async fn internal_toggle_maximize( window: Window, label: Option, ) -> Result<()> { @@ -184,7 +184,7 @@ pub fn internal_toggle_maximize( #[cfg(any(debug_assertions, feature = "devtools"))] #[tauri::command] -pub fn internal_toggle_devtools( +pub async fn internal_toggle_devtools( window: Window, label: Option, ) -> Result<()> {