chore: update tauri

This commit is contained in:
Lucas Nogueira
2026-09-08 17:53:34 -03:00
parent 1423992771
commit 835adce473
34 changed files with 866 additions and 272 deletions
+16 -2
View File
@@ -43,9 +43,7 @@ tauri-plugin-upload = { path = "../../../plugins/upload", version = "2.3.0" }
[dependencies.tauri]
workspace = true
features = [
"wry",
"common-controls-v6",
"x11",
"image-ico",
"image-png",
"isolation",
@@ -54,6 +52,19 @@ features = [
"protocol-asset",
]
# The webview runtime is picked by depending on its crate and handing its
# attributes to `tauri::Builder::runtime`. `macos-private-api` only reaches the
# runtime when it is enabled on the runtime crate as well.
[dependencies.tauri-runtime-wry]
workspace = true
optional = true
features = ["common-controls-v6", "macos-private-api"]
[dependencies.tauri-runtime-cef]
workspace = true
optional = true
features = ["macos-private-api"]
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.4.1" }
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.3.2" }
@@ -68,4 +79,7 @@ tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "
tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.3.2" }
[features]
default = ["wry"]
wry = ["dep:tauri-runtime-wry"]
cef = ["dep:tauri-runtime-cef"]
prod = ["tauri/custom-protocol"]
+17 -3
View File
@@ -3,7 +3,9 @@
// SPDX-License-Identifier: MIT
mod cmd;
#[cfg(desktop)]
// The CEF runtime has no tray icon integration, so the tray is only set up on
// the wry runtime.
#[cfg(all(desktop, not(feature = "cef")))]
mod tray;
use serde::Serialize;
@@ -20,10 +22,19 @@ struct Reply {
pub type SetupHook = Box<dyn FnOnce(&mut App) -> Result<(), Box<dyn std::error::Error>> + Send>;
pub type OnEvent = Box<dyn FnMut(&AppHandle, RunEvent)>;
// Every CEF application is also its own renderer, GPU, network and utility
// process. This attribute runs the helper side of that and returns before the
// Tauri application is built, for any process Chromium launched with `--type=`.
#[cfg_attr(feature = "cef", tauri_runtime_cef::cef_entry_point)]
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
#[cfg(feature = "cef")]
let builder = tauri::Builder::default().runtime(tauri_runtime_cef::Cef::default());
#[cfg(not(feature = "cef"))]
let builder = tauri::Builder::default().runtime(tauri_runtime_wry::Wry::default());
#[allow(unused_mut)]
let mut builder = tauri::Builder::default()
let mut builder = builder
.plugin(
tauri_plugin_log::Builder::default()
.level(log::LevelFilter::Info)
@@ -43,6 +54,7 @@ pub fn run() {
.setup(move |app| {
#[cfg(desktop)]
{
#[cfg(not(feature = "cef"))]
tray::create_tray(app.handle())?;
app.handle().plugin(tauri_plugin_cli::init())?;
app.handle()
@@ -170,7 +182,9 @@ pub fn run() {
app.set_activation_policy(tauri::ActivationPolicy::Regular);
app.run(move |_app_handle, _event| {
#[cfg(desktop)]
// Only the tray icon keeps this app useful without windows, and there is
// no tray on CEF.
#[cfg(all(desktop, not(feature = "cef")))]
if let RunEvent::ExitRequested { code, api, .. } = &_event {
if code.is_none() {
// Keep the event loop running even if all windows are closed