diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 798549b5..e0d6915b 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -4026,9 +4026,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -4557,9 +4557,9 @@ dependencies = [ [[package]] name = "tao" -version = "0.30.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a93f2c6b8fdaeb7f417bda89b5bc767999745c3052969664ae1fa65892deb7e" +checksum = "82e7ede56f9ef03a0bb384c7b2bed4f3985ee7f3f79ec887c50d8466eec21096" dependencies = [ "bitflags 2.6.0", "cocoa", @@ -5509,9 +5509,9 @@ checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "untrusted" @@ -5769,9 +5769,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.5" +version = "0.26.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" dependencies = [ "rustls-pki-types", ] @@ -6392,9 +6392,9 @@ dependencies = [ [[package]] name = "wry" -version = "0.44.0" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7e385ebabe006332d3863482297408cb39d778db41009f50896ac356d8c49e" +checksum = "440600584cfbd8b0d28eace95c1f2c253db05dae43780b79380aa1e868f04c73" dependencies = [ "base64 0.22.1", "block", diff --git a/src-tauri/src/functionality/rpc.rs b/src-tauri/src/functionality/rpc.rs index 303b26bc..9ba8ecfd 100644 --- a/src-tauri/src/functionality/rpc.rs +++ b/src-tauri/src/functionality/rpc.rs @@ -152,7 +152,7 @@ pub fn start_rpc_server(win: tauri::WebviewWindow) { .append_detectables(get_local_detectables()); loop { - std::thread::sleep(std::time::Duration::from_millis(10)); + std::thread::sleep(std::time::Duration::from_secs(1)); } } diff --git a/src-tauri/src/processors/css_preprocess.rs b/src-tauri/src/processors/css_preprocess.rs index be444229..f078b1fa 100644 --- a/src-tauri/src/processors/css_preprocess.rs +++ b/src-tauri/src/processors/css_preprocess.rs @@ -22,7 +22,7 @@ pub async fn clear_css_cache() { pub fn localize_imports(win: tauri::WebviewWindow, css: String, name: String) -> String { use regex::Regex; use tauri::Emitter; - + use crate::config::get_config; let reg = Regex::new(r#"(?m)^@import url\((?:"|'|)(?:|.+?)\/\/(.+?)(?:"|'|)\);"#).unwrap(); diff --git a/src-tauri/src/util/window_helpers.rs b/src-tauri/src/util/window_helpers.rs index fa348465..21e0096b 100644 --- a/src-tauri/src/util/window_helpers.rs +++ b/src-tauri/src/util/window_helpers.rs @@ -153,4 +153,4 @@ pub fn ultrashow(win: &tauri::WebviewWindow) { win.unminimize().unwrap_or_default(); win.show().unwrap_or_default(); win.set_focus().unwrap_or_default(); -} \ No newline at end of file +} diff --git a/src-tauri/src/window/blur.rs b/src-tauri/src/window/blur.rs index 552cfdd6..231a20fe 100644 --- a/src-tauri/src/window/blur.rs +++ b/src-tauri/src/window/blur.rs @@ -17,41 +17,38 @@ pub fn available_blurs() -> Vec<&'static str> { } } +#[cfg(target_os = "windows")] #[tauri::command] pub fn apply_effect(win: tauri::WebviewWindow, effect: &str) { - #[cfg(target_os = "windows")] - { - use window_vibrancy::{apply_acrylic, apply_blur, apply_mica}; + use window_vibrancy::{apply_acrylic, apply_blur, apply_mica}; - match effect { - "blur" => apply_blur(win, Some((18, 18, 18, 125))).unwrap_or_default(), - "acrylic" => apply_acrylic(win, Some((18, 18, 18, 125))).unwrap_or_default(), - "mica" => apply_mica(win, None).unwrap_or_default(), - _ => (), - } + match effect { + "blur" => apply_blur(win, Some((18, 18, 18, 125))).unwrap_or_default(), + "acrylic" => apply_acrylic(win, Some((18, 18, 18, 125))).unwrap_or_default(), + "mica" => apply_mica(win, None).unwrap_or_default(), + _ => (), } +} - #[cfg(target_os = "macos")] - { - use window_vibrancy::{apply_vibrancy, NSVisualEffectMaterial}; +#[cfg(target_os = "macos")] +#[tauri::command] +pub fn apply_effect(win: tauri::WebviewWindow, effect: &str) { + use window_vibrancy::{apply_vibrancy, NSVisualEffectMaterial}; - #[allow(clippy::single_match)] - match effect { - "vibrancy" => { - apply_vibrancy(win, NSVisualEffectMaterial::HudWindow, None, None).unwrap_or_default() - } - _ => {} + #[allow(clippy::single_match)] + match effect { + "vibrancy" => { + apply_vibrancy(win, NSVisualEffectMaterial::HudWindow, None, None).unwrap_or_default() } - } - - #[cfg(target_os = "linux")] - { - // Sorry linux :/ - let _ = win; - let _ = effect; + _ => {} } } +// Sorry linux :/ +#[cfg(target_os = "linux")] +#[tauri::command] +pub fn apply_effect(_win: tauri::WebviewWindow, _effect: &str) {} + // Might use this one day, today is not that day // #[tauri::command] // pub fn remove_effect(win: tauri::WebviewWindow) {