diff --git a/.changes/positioner-tauri-2.8.md b/.changes/positioner-tauri-2.8.md new file mode 100644 index 0000000000..318747965e --- /dev/null +++ b/.changes/positioner-tauri-2.8.md @@ -0,0 +1,6 @@ +--- +positioner: patch +positioner-js: patch +--- + +Add type annotation on `WebviewWindow::as_ref` calls in prepare for https://github.com/tauri-apps/tauri/pull/14012 that will be released in tauri 2.8 diff --git a/.changes/window-state-tauri-2.8.md b/.changes/window-state-tauri-2.8.md new file mode 100644 index 0000000000..7055b16bcd --- /dev/null +++ b/.changes/window-state-tauri-2.8.md @@ -0,0 +1,6 @@ +--- +window-state: patch +window-state-js: patch +--- + +Add type annotation on `WebviewWindow::as_ref` calls in prepare for https://github.com/tauri-apps/tauri/pull/14012 that will be released in tauri 2.8 diff --git a/plugins/positioner/src/ext.rs b/plugins/positioner/src/ext.rs index b3d405ea25..35860d9970 100644 --- a/plugins/positioner/src/ext.rs +++ b/plugins/positioner/src/ext.rs @@ -10,7 +10,7 @@ use serde_repr::Deserialize_repr; use tauri::Manager; #[cfg(feature = "tray-icon")] use tauri::Monitor; -use tauri::{PhysicalPosition, PhysicalSize, Result, Runtime, WebviewWindow, Window}; +use tauri::{PhysicalPosition, PhysicalSize, Result, Runtime, Webview, WebviewWindow, Window}; /// Well known window positions. #[derive(Debug, Deserialize_repr)] @@ -57,12 +57,16 @@ pub trait WindowExt { impl WindowExt for WebviewWindow { fn move_window(&self, pos: Position) -> Result<()> { - self.as_ref().window().move_window(pos) + // TODO: Use `let webview: &Window = self.as_ref()` instead after tauri 2.8 released + let webview: &Webview = self.as_ref(); + webview.window().move_window(pos) } #[cfg(feature = "tray-icon")] fn move_window_constrained(&self, position: Position) -> Result<()> { - self.as_ref().window().move_window_constrained(position) + // TODO: Use `let webview: &Window = self.as_ref()` instead after tauri 2.8 released + let webview: &Webview = self.as_ref(); + webview.window().move_window_constrained(position) } } diff --git a/plugins/window-state/src/lib.rs b/plugins/window-state/src/lib.rs index 42c0fdf6dc..93ee36e9e7 100644 --- a/plugins/window-state/src/lib.rs +++ b/plugins/window-state/src/lib.rs @@ -14,8 +14,8 @@ use bitflags::bitflags; use serde::{Deserialize, Serialize}; use tauri::{ plugin::{Builder as PluginBuilder, TauriPlugin}, - AppHandle, Manager, Monitor, PhysicalPosition, PhysicalSize, RunEvent, Runtime, WebviewWindow, - Window, WindowEvent, + AppHandle, Manager, Monitor, PhysicalPosition, PhysicalSize, RunEvent, Runtime, Webview, + WebviewWindow, Window, WindowEvent, }; use std::{ @@ -158,7 +158,9 @@ pub trait WindowExt { impl WindowExt for WebviewWindow { fn restore_state(&self, flags: StateFlags) -> tauri::Result<()> { - self.as_ref().window().restore_state(flags) + // TODO: Use `let webview: &Window = self.as_ref()` instead after tauri 2.8 released + let webview: &Webview = self.as_ref(); + webview.window().restore_state(flags) } } @@ -274,7 +276,9 @@ trait WindowExtInternal { impl WindowExtInternal for WebviewWindow { fn update_state(&self, state: &mut WindowState, flags: StateFlags) -> tauri::Result<()> { - self.as_ref().window().update_state(state, flags) + // TODO: Use `let webview: &Window = self.as_ref()` instead after tauri 2.8 released + let webview: &Webview = self.as_ref(); + webview.window().update_state(state, flags) } }