mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 04:33:45 +08:00
fix: the deadlock caused by incorrect call of window_state due to document error
This commit is contained in:
parent
0041ff13b8
commit
0782b25830
@ -8,7 +8,6 @@ use percent_encoding::percent_decode_str;
|
|||||||
use serde_yaml::Mapping;
|
use serde_yaml::Mapping;
|
||||||
use std::net::TcpListener;
|
use std::net::TcpListener;
|
||||||
use tauri::{App, Manager};
|
use tauri::{App, Manager};
|
||||||
use tauri_plugin_window_state::{StateFlags, WindowExt};
|
|
||||||
|
|
||||||
use url::Url;
|
use url::Url;
|
||||||
//#[cfg(not(target_os = "linux"))]
|
//#[cfg(not(target_os = "linux"))]
|
||||||
@ -128,8 +127,9 @@ pub fn create_window() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
println!("create window");
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
let window = {
|
let _ = {
|
||||||
let app_handle = app_handle.clone();
|
let app_handle = app_handle.clone();
|
||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || {
|
||||||
tauri::WebviewWindowBuilder::new(
|
tauri::WebviewWindowBuilder::new(
|
||||||
@ -150,7 +150,7 @@ pub fn create_window() {
|
|||||||
}.unwrap();
|
}.unwrap();
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
let window = tauri::WebviewWindowBuilder::new(
|
let _ = tauri::WebviewWindowBuilder::new(
|
||||||
&app_handle,
|
&app_handle,
|
||||||
"main".to_string(),
|
"main".to_string(),
|
||||||
tauri::WebviewUrl::App("index.html".into()),
|
tauri::WebviewUrl::App("index.html".into()),
|
||||||
@ -164,7 +164,7 @@ pub fn create_window() {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
let window = tauri::WebviewWindowBuilder::new(
|
let _ = tauri::WebviewWindowBuilder::new(
|
||||||
&app_handle,
|
&app_handle,
|
||||||
"main".to_string(),
|
"main".to_string(),
|
||||||
tauri::WebviewUrl::App("index.html".into()),
|
tauri::WebviewUrl::App("index.html".into()),
|
||||||
@ -176,8 +176,6 @@ pub fn create_window() {
|
|||||||
.transparent(true)
|
.transparent(true)
|
||||||
.build()
|
.build()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
log_err!(window.restore_state(StateFlags::all()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn resolve_scheme(param: String) -> Result<()> {
|
pub async fn resolve_scheme(param: String) -> Result<()> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user