From 20e1c6e91b02bb37c710f8ab3c763a3ffd3a40ab Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Sat, 30 Nov 2024 21:29:42 +0800 Subject: [PATCH] refactor: upgrade tauri 2.0 --- crates/gpapi/src/utils/window.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/gpapi/src/utils/window.rs b/crates/gpapi/src/utils/window.rs index d9a52d9..f8ad124 100644 --- a/crates/gpapi/src/utils/window.rs +++ b/crates/gpapi/src/utils/window.rs @@ -2,7 +2,7 @@ use std::{process::ExitStatus, time::Duration}; use anyhow::bail; use log::info; -use tauri::Window; +use tauri::WebviewWindow; use tokio::process::Command; pub trait WindowExt { @@ -10,7 +10,7 @@ pub trait WindowExt { fn hide_menu(&self); } -impl WindowExt for Window { +impl WindowExt for WebviewWindow { fn raise(&self) -> anyhow::Result<()> { raise_window(self) } @@ -20,7 +20,7 @@ impl WindowExt for Window { } } -pub fn raise_window(win: &Window) -> anyhow::Result<()> { +pub fn raise_window(win: &WebviewWindow) -> anyhow::Result<()> { let is_wayland = std::env::var("XDG_SESSION_TYPE").unwrap_or_default() == "wayland"; if is_wayland { @@ -77,7 +77,7 @@ async fn wmctrl_try_raise_window(title: &str) -> anyhow::Result { Ok(exit_status) } -fn hide_menu(win: &Window) { +fn hide_menu(win: &WebviewWindow) { // let menu_handle = win.menu_handle(); // tokio::spawn(async move {