Merge remote-tracking branch 'origin/v2' into feat/cef

This commit is contained in:
Lucas Nogueira
2026-06-22 09:09:23 -03:00
26 changed files with 586 additions and 419 deletions
+4
View File
@@ -1,5 +1,9 @@
# Changelog
## \[2.4.5]
- [`d8645ab3`](https://github.com/tauri-apps/plugins-workspace/commit/d8645ab3e5b508456681eb53275c0837db25aeee) ([#3393](https://github.com/tauri-apps/plugins-workspace/pull/3393) by [@AlexisZankowitch](https://github.com/tauri-apps/plugins-workspace/../../AlexisZankowitch)) Fixed a crash on iOS when `cancel()` is invoked by running the cancel handler on the main thread.
## \[2.4.4]
- [`82fbb0c7`](https://github.com/tauri-apps/plugins-workspace/commit/82fbb0c790288eca72af9ade13828ded7700ff90) ([#3221](https://github.com/tauri-apps/plugins-workspace/pull/3221)) On iOS, fixed an application crash happening when the scanner was started when user denied permission before.
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "tauri-plugin-barcode-scanner"
version = "2.4.4"
version = "2.4.5"
description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS"
edition = { workspace = true }
authors = { workspace = true }
@@ -337,10 +337,11 @@ class BarcodeScannerPlugin: Plugin, AVCaptureMetadataOutputObjectsDelegate {
}
@objc private func cancel(_ invoke: Invoke) {
self.invoke?.reject("cancelled")
destroy()
invoke.resolve()
DispatchQueue.main.async { [self] in
self.invoke?.reject("cancelled")
self.destroy()
invoke.resolve()
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@tauri-apps/plugin-barcode-scanner",
"version": "2.4.4",
"version": "2.4.5",
"description": "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS",
"license": "MIT OR Apache-2.0",
"authors": [
+1 -1
View File
@@ -707,7 +707,7 @@ pub async fn read_text_file_lines_next<R: Runtime>(
let lines = resource_table.get::<StdLinesResource>(rid)?;
let ret = StdLinesResource::with_lock(&lines, |lines| -> CommandResult<Vec<u8>> {
// This is an optimization to include wether we finished iteration or not (1 or 0)
// This is an optimization to include whether we finished iteration or not (1 or 0)
// at the end of returned vector so we can use `tauri::ipc::Response`
// and avoid serialization overhead of separate values.
match lines.next() {
+4
View File
@@ -1,5 +1,9 @@
# Changelog
## \[2.3.2]
- [`cb863d57`](https://github.com/tauri-apps/plugins-workspace/commit/cb863d57c60790efc41b2bd77d065bd91b4ef2b1) ([#3408](https://github.com/tauri-apps/plugins-workspace/pull/3408) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update crate `global-hotkey` to 0.8 to fix cpu usage while pressing the keys on windows and to add F13-F24 mappings on Linux/X11.
## \[2.3.1]
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
+2 -2
View File
@@ -1,6 +1,6 @@
[package]
name = "tauri-plugin-global-shortcut"
version = "2.3.1"
version = "2.3.2"
description = "Register global hotkeys listeners on your Tauri application."
edition = { workspace = true }
authors = { workspace = true }
@@ -27,4 +27,4 @@ log = { workspace = true }
thiserror = { workspace = true }
[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]
global-hotkey = { version = "0.7", features = ["serde"] }
global-hotkey = { version = "0.8", features = ["serde"] }
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@tauri-apps/plugin-global-shortcut",
"version": "2.3.1",
"version": "2.3.2",
"license": "MIT OR Apache-2.0",
"authors": [
"Tauri Programme within The Commons Conservancy"
+1 -1
View File
@@ -62,7 +62,7 @@ Afterwards all the plugin's APIs are available through the JavaScript guest bind
import { fetch } from '@tauri-apps/plugin-http'
const response = await fetch('http://localhost:3003/users/2', {
method: 'GET',
timeout: 30
connectTimeout: 30
})
```
-1
View File
@@ -25,7 +25,6 @@ serde_json = { workspace = true }
tauri = { workspace = true }
thiserror = { workspace = true }
serde_repr = "0.1"
byte-unit = "5"
log = { workspace = true, features = ["kv_unstable"] }
time = { version = "0.3", features = [
"formatting",
+152 -4
View File
@@ -43,9 +43,10 @@ mod ios {
));
}
const DEFAULT_MAX_FILE_SIZE: u64 = 40000;
const DEFAULT_MAX_FILE_SIZE: u64 = 40_000;
const DEFAULT_ROTATION_STRATEGY: RotationStrategy = RotationStrategy::KeepOne;
const DEFAULT_TIMEZONE_STRATEGY: TimezoneStrategy = TimezoneStrategy::UseUtc;
const DEFAULT_FILE_OPEN_STRATEGY: FileOpenStrategy = FileOpenStrategy::Append;
const DEFAULT_LOG_TARGETS: [Target; 2] = [
Target::new(TargetKind::Stdout),
Target::new(TargetKind::LogDir { file_name: None }),
@@ -146,15 +147,26 @@ impl TimezoneStrategy {
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum FileOpenStrategy {
/// Open existing file from last session and append, if any.
Append,
/// Create a new file on each session start, rotating the last session if any.
Rotate,
}
/// A custom log writer that rotates the log file when it exceeds specified size.
struct RotatingFile {
dir: PathBuf,
file_name: String,
path: PathBuf,
/// Maximum file size before rotating in bytes
max_size: u64,
/// Current file size in bytes
current_size: u64,
rotation_strategy: RotationStrategy,
timezone_strategy: TimezoneStrategy,
file_open_strategy: FileOpenStrategy,
inner: Option<File>,
buffer: Vec<u8>,
}
@@ -166,6 +178,7 @@ impl RotatingFile {
max_size: u64,
rotation_strategy: RotationStrategy,
timezone_strategy: TimezoneStrategy,
file_open_strategy: FileOpenStrategy,
) -> Result<Self, Error> {
let dir = dir.as_ref().to_path_buf();
let path = dir.join(&file_name).with_extension("log");
@@ -178,12 +191,15 @@ impl RotatingFile {
current_size: 0,
rotation_strategy,
timezone_strategy,
file_open_strategy,
inner: None,
buffer: Vec::new(),
};
rotator.open_file()?;
if rotator.current_size >= rotator.max_size {
if rotator.current_size >= rotator.max_size
|| (rotator.current_size > 0 && rotator.file_open_strategy == FileOpenStrategy::Rotate)
{
rotator.rotate()?;
}
if let RotationStrategy::KeepSome(keep_count) = rotator.rotation_strategy {
@@ -396,6 +412,7 @@ pub struct Builder {
dispatch: fern::Dispatch,
rotation_strategy: RotationStrategy,
timezone_strategy: TimezoneStrategy,
file_open_strategy: FileOpenStrategy,
max_file_size: u128,
targets: Vec<Target>,
is_skip_logger: bool,
@@ -423,6 +440,7 @@ impl Default for Builder {
dispatch,
rotation_strategy: DEFAULT_ROTATION_STRATEGY,
timezone_strategy: DEFAULT_TIMEZONE_STRATEGY,
file_open_strategy: DEFAULT_FILE_OPEN_STRATEGY,
max_file_size: DEFAULT_MAX_FILE_SIZE as u128,
targets: DEFAULT_LOG_TARGETS.into(),
is_skip_logger: false,
@@ -435,11 +453,18 @@ impl Builder {
Default::default()
}
/// Sets the [`RotationStrategy`].
///
/// Default is [`RotationStrategy::KeepOne`]
pub fn rotation_strategy(mut self, rotation_strategy: RotationStrategy) -> Self {
self.rotation_strategy = rotation_strategy;
self
}
/// Sets the [`TimezoneStrategy`].
/// Calling this method overrides the format set in [`Self::format`].
///
/// Default is [`TimezoneStrategy::UseUtc`]
pub fn timezone_strategy(mut self, timezone_strategy: TimezoneStrategy) -> Self {
self.timezone_strategy = timezone_strategy.clone();
@@ -456,15 +481,28 @@ impl Builder {
self
}
/// Sets the maximum file size for log rotation.
/// Sets the strategy to open the log file.
///
/// Values larger than `u64::MAX` will be clamped to `u64::MAX`.
/// The default is [`FileOpenStrategy::Append`].
pub fn file_open_strategy(mut self, file_open_strategy: FileOpenStrategy) -> Self {
self.file_open_strategy = file_open_strategy;
self
}
/// Sets the maximum file size in bytes for log rotation.
///
/// Values larger than [`u64::MAX`] will be clamped to [`u64::MAX`].
/// In v3, this parameter will be changed to `u64`.
///
/// Default is `40_000`
pub fn max_file_size(mut self, max_file_size: u128) -> Self {
self.max_file_size = max_file_size.min(u64::MAX as u128);
self
}
/// Clears the format so that only the message is logged.
///
/// e.g. `log::info!("message")` will log out `message`
pub fn clear_format(mut self) -> Self {
self.dispatch = self.dispatch.format(|out, message, _record| {
out.finish(format_args!("{message}"));
@@ -472,6 +510,37 @@ impl Builder {
self
}
/// Sets the formatter of this dispatch. The closure should accept a
/// callback, a message and a log record, and write the resulting
/// format to the writer.
///
/// The log record is passed for completeness, but the `args()` method of
/// the record should be ignored, and the [`std::fmt::Arguments`] given
/// should be used instead. `record.args()` may be used to retrieve the
/// _original_ log message, but in order to allow for true log
/// chaining, formatters should use the given message instead whenever
/// including the message in the output.
///
/// To avoid all allocation of intermediate results, the formatter is
/// "completed" by calling a callback, which then calls the rest of the
/// logging chain with the new formatted message. The callback object keeps
/// track of if it was called or not via a stack boolean as well, so if
/// you don't use `out.finish` the log message will continue down
/// the logger chain unformatted.
///
/// Example usage:
///
/// ```
/// tauri_plugin_log::Builder::new()
/// .format(|out, message, record| {
/// out.finish(format_args!(
/// "[{} {}] {}",
/// record.level(),
/// record.target(),
/// message
/// ))
/// });
/// ```
pub fn format<F>(mut self, formatter: F) -> Self
where
F: Fn(FormatCallback, &Arguments, &Record) + Sync + Send + 'static,
@@ -480,16 +549,64 @@ impl Builder {
self
}
/// Sets the overarching level filter for this logger.
/// All messages not already filtered by something set by [`Self::level_for`] will be affected.
///
/// All messages filtered will be discarded if less severe than the given level.
///
/// Default level is [`log::LevelFilter::Trace`].
pub fn level(mut self, level_filter: impl Into<LevelFilter>) -> Self {
self.dispatch = self.dispatch.level(level_filter.into());
self
}
/// Sets a per-target log level filter. Default target for log messages is
/// `crate_name::module_name` or
/// `crate_name` for logs in the crate root. Targets can also be set with
/// `info!(target: "target-name", ...)`.
///
/// For each log record fern will first try to match the most specific
/// level_for, and then progressively more general ones until either a
/// matching level is found, or the default level is used.
///
/// For example, a log for the target `hyper::http::h1` will first test a
/// level_for for `hyper::http::h1`, then for `hyper::http`, then for
/// `hyper`, then use the default level.
///
/// Examples:
///
/// A program wants to include a lot of debugging output, but the library
/// "hyper" is known to work well, so debug output from it should be
/// excluded:
///
/// ```
/// # fn main() {
/// tauri_plugin_log::Builder::new()
/// .level(log::LevelFilter::Trace)
/// .level_for("hyper", log::LevelFilter::Info)
/// # ;
/// # }
/// ```
pub fn level_for(mut self, module: impl Into<Cow<'static, str>>, level: LevelFilter) -> Self {
self.dispatch = self.dispatch.level_for(module, level);
self
}
/// Adds a custom filter which can reject messages passing through this logger.
///
/// [`Self::level`] and [`Self::level_for`] are preferred if applicable.
///
/// Example usage:
///
/// ```
/// # fn main() {
/// tauri_plugin_log::Builder::new()
/// .level(log::LevelFilter::Info)
/// .filter(|metadata| {
/// // Reject messages with the `Error` log level.
/// metadata.level() != log::LevelFilter::Error
/// })
/// # }
pub fn filter<F>(mut self, filter: F) -> Self
where
F: Fn(&log::Metadata) -> bool + Send + Sync + 'static,
@@ -511,6 +628,19 @@ impl Builder {
/// tauri_plugin_log::Builder::new()
/// .target(Target::new(TargetKind::Webview));
/// ```
///
/// The default targets are
///
/// ```rust
/// # use tauri_plugin_log::{Target, TargetKind, Builder};
/// # Builder::new()
/// # .targets(
/// [
/// Target::new(TargetKind::Stdout),
/// Target::new(TargetKind::LogDir { file_name: None }),
/// ]
/// # );
/// ```
pub fn target(mut self, target: Target) -> Self {
self.targets.push(target);
self
@@ -543,6 +673,19 @@ impl Builder {
/// Target::new(TargetKind::LogDir { file_name: Some("rust".into()) }).filter(|metadata| !metadata.target().starts_with(WEBVIEW_TARGET)),
/// ]);
/// ```
///
/// The default targets are
///
/// ```rust
/// # use tauri_plugin_log::{Target, TargetKind, Builder};
/// # Builder::new()
/// # .targets(
/// [
/// Target::new(TargetKind::Stdout),
/// Target::new(TargetKind::LogDir { file_name: None }),
/// ]
/// # );
/// ```
pub fn targets(mut self, targets: impl IntoIterator<Item = Target>) -> Self {
self.targets = Vec::from_iter(targets);
self
@@ -569,6 +712,7 @@ impl Builder {
mut dispatch: fern::Dispatch,
rotation_strategy: RotationStrategy,
timezone_strategy: TimezoneStrategy,
file_open_strategy: FileOpenStrategy,
max_file_size: u64,
targets: Vec<Target>,
) -> Result<(log::LevelFilter, Box<dyn log::Log>), Error> {
@@ -621,6 +765,7 @@ impl Builder {
max_file_size,
rotation_strategy.clone(),
timezone_strategy.clone(),
file_open_strategy.clone(),
)?;
fern::Output::writer(Box::new(rotator), "\n")
}
@@ -636,6 +781,7 @@ impl Builder {
max_file_size,
rotation_strategy.clone(),
timezone_strategy.clone(),
file_open_strategy.clone(),
)?;
fern::Output::writer(Box::new(rotator), "\n")
}
@@ -681,6 +827,7 @@ impl Builder {
self.dispatch,
self.rotation_strategy,
self.timezone_strategy,
self.file_open_strategy,
self.max_file_size as u64,
self.targets,
)?;
@@ -697,6 +844,7 @@ impl Builder {
self.dispatch,
self.rotation_strategy,
self.timezone_strategy,
self.file_open_strategy,
self.max_file_size as u64,
self.targets,
)?;
+4
View File
@@ -1,5 +1,9 @@
# Changelog
## \[2.3.2]
- [`c0d64bf7`](https://github.com/tauri-apps/plugins-workspace/commit/c0d64bf7d9c0f2c8ed1d2614745e15bbb3cde6a7) ([#3420](https://github.com/tauri-apps/plugins-workspace/pull/3420) by [@UrsDeSwardt](https://github.com/tauri-apps/plugins-workspace/../../UrsDeSwardt)) Removed panics and replaced them with error handling.
## \[2.3.1]
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "tauri-plugin-positioner"
version = "2.3.1"
version = "2.3.2"
description = "Position your windows at well-known locations."
authors = { workspace = true }
license = { workspace = true }
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@tauri-apps/plugin-positioner",
"version": "2.3.1",
"version": "2.3.2",
"description": "Position your windows at well-known locations.",
"license": "MIT OR Apache-2.0",
"authors": [
+21 -7
View File
@@ -152,7 +152,9 @@ fn calculate_position<R: Runtime>(
) -> Result<PhysicalPosition<i32>> {
use Position::*;
let screen = window.current_monitor()?.unwrap();
let screen = window.current_monitor()?.ok_or_else(|| {
tauri::Error::Io(std::io::Error::other("No monitor found for the window"))
})?;
// Only use the screen_position for the Tray independent positioning,
// because a tray event may not be called on the currently active monitor.
let screen_position = screen.position();
@@ -225,7 +227,9 @@ fn calculate_position<R: Runtime>(
PhysicalPosition { x: tray_x, y }
} else {
panic!("Tray position not set");
return Err(tauri::Error::Io(std::io::Error::other(
"Tray position not set",
)));
}
}
#[cfg(feature = "tray-icon")]
@@ -236,7 +240,9 @@ fn calculate_position<R: Runtime>(
y: tray_y,
}
} else {
panic!("Tray position not set");
return Err(tauri::Error::Io(std::io::Error::other(
"Tray position not set",
)));
}
}
#[cfg(feature = "tray-icon")]
@@ -257,7 +263,9 @@ fn calculate_position<R: Runtime>(
y,
}
} else {
panic!("Tray position not set");
return Err(tauri::Error::Io(std::io::Error::other(
"Tray position not set",
)));
}
}
#[cfg(feature = "tray-icon")]
@@ -268,7 +276,9 @@ fn calculate_position<R: Runtime>(
y: tray_y,
}
} else {
panic!("Tray position not set");
return Err(tauri::Error::Io(std::io::Error::other(
"Tray position not set",
)));
}
}
#[cfg(feature = "tray-icon")]
@@ -287,7 +297,9 @@ fn calculate_position<R: Runtime>(
PhysicalPosition { x, y }
} else {
panic!("Tray position not set");
return Err(tauri::Error::Io(std::io::Error::other(
"Tray position not set",
)));
}
}
#[cfg(feature = "tray-icon")]
@@ -298,7 +310,9 @@ fn calculate_position<R: Runtime>(
y: tray_y,
}
} else {
panic!("Tray position not set");
return Err(tauri::Error::Io(std::io::Error::other(
"Tray position not set",
)));
}
}
};
+6 -6
View File
@@ -1822,9 +1822,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
[[package]]
name = "openssl"
version = "0.10.79"
version = "0.10.80"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf0b434746ee2832f4f0baf10137e1cabb18cbe6912c69e2e33263c45250f542"
checksum = "a45fa2aa886c42762255da344f0a0d313e254066c46aad76f300c3d3da62d967"
dependencies = [
"bitflags 2.6.0",
"cfg-if",
@@ -1853,9 +1853,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "openssl-sys"
version = "0.9.115"
version = "0.9.116"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "158fe5b292746440aa6e7a7e690e55aeb72d41505e2804c23c6973ad0e9c9781"
checksum = "f28a22dc7140cda5f096e5e7724a6962ca81a7f8bfd2979f9b18c11af56318c4"
dependencies = [
"cc",
"libc",
@@ -2950,9 +2950,9 @@ dependencies = [
[[package]]
name = "tar"
version = "0.4.45"
version = "0.4.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22692a6476a21fa75fdfc11d452fda482af402c008cdbaf3476414e122040973"
checksum = "3f6221d9a6003c78398e3b239969f352578258df48c8eb051caadae0015bc840"
dependencies = [
"filetime",
"libc",