Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/positioner-tauri-2.8.md
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions .changes/window-state-tauri-2.8.md
Original file line number Diff line number Diff line change
@@ -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
10 changes: 7 additions & 3 deletions plugins/positioner/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -57,12 +57,16 @@ pub trait WindowExt {

impl<R: Runtime> WindowExt for WebviewWindow<R> {
fn move_window(&self, pos: Position) -> Result<()> {
self.as_ref().window().move_window(pos)
// TODO: Use `let webview: &Window<R> = self.as_ref()` instead after tauri 2.8 released
let webview: &Webview<R> = 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<R> = self.as_ref()` instead after tauri 2.8 released
let webview: &Webview<R> = self.as_ref();
webview.window().move_window_constrained(position)
}
}

Expand Down
12 changes: 8 additions & 4 deletions plugins/window-state/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -158,7 +158,9 @@ pub trait WindowExt {

impl<R: Runtime> WindowExt for WebviewWindow<R> {
fn restore_state(&self, flags: StateFlags) -> tauri::Result<()> {
self.as_ref().window().restore_state(flags)
// TODO: Use `let webview: &Window<R> = self.as_ref()` instead after tauri 2.8 released
let webview: &Webview<R> = self.as_ref();
webview.window().restore_state(flags)
}
}

Expand Down Expand Up @@ -274,7 +276,9 @@ trait WindowExtInternal {

impl<R: Runtime> WindowExtInternal for WebviewWindow<R> {
fn update_state(&self, state: &mut WindowState, flags: StateFlags) -> tauri::Result<()> {
self.as_ref().window().update_state(state, flags)
// TODO: Use `let webview: &Window<R> = self.as_ref()` instead after tauri 2.8 released
let webview: &Webview<R> = self.as_ref();
webview.window().update_state(state, flags)
}
}

Expand Down
Loading