chore(deps): update muda to 0.15 and tray-icon to 0.18 (#11097)

This commit is contained in:
Amr Bashir 2024-09-24 00:20:40 +03:00 committed by GitHub
parent 28169ae097
commit d369e8db5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 35 additions and 26 deletions

13
Cargo.lock generated
View File

@ -4061,17 +4061,18 @@ dependencies = [
[[package]]
name = "muda"
version = "0.14.1"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba8ac4080fb1e097c2c22acae467e46e4da72d941f02e82b67a87a2a89fa38b1"
checksum = "6bff4998d40ca6ec6610f958d48b57a87b62506bfccad71f49fcda0b63f19a32"
dependencies = [
"cocoa 0.26.0",
"crossbeam-channel",
"dpi",
"gtk",
"keyboard-types",
"libxdo",
"objc",
"objc2",
"objc2-app-kit",
"objc2-foundation",
"once_cell",
"png",
"serde",
@ -8178,9 +8179,9 @@ dependencies = [
[[package]]
name = "tray-icon"
version = "0.17.0"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "044d7738b3d50f288ddef035b793228740ad4d927f5466b0af55dc15e7e03cfe"
checksum = "f1730884cee088bb1dc1570c0a8b70a59e740ee780563407fd249e3e11ef26ff"
dependencies = [
"core-graphics 0.24.0",
"crossbeam-channel",

View File

@ -91,8 +91,8 @@ specta = { version = "^2.0.0-rc.16", optional = true, default-features = false,
] }
[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\", target_os = \"windows\", target_os = \"macos\"))".dependencies]
muda = { version = "0.14", default-features = false, features = ["serde"] }
tray-icon = { version = "0.17", default-features = false, features = [
muda = { version = "0.15", default-features = false, features = ["serde"] }
tray-icon = { version = "0.18", default-features = false, features = [
"serde",
], optional = true }

View File

@ -76,7 +76,7 @@ impl<R: Runtime> MenuManager<R> {
let theme = theme
.map(crate::menu::map_to_menu_theme)
.unwrap_or(muda::MenuTheme::Auto);
let _ = menu.inner().init_for_hwnd_with_theme(raw.hwnd as _, theme);
let _ = unsafe { menu.inner().init_for_hwnd_with_theme(raw.hwnd as _, theme) };
}
#[cfg(any(
target_os = "linux",

View File

@ -44,9 +44,11 @@ impl<R: Runtime> ContextMenuBase for Menu<R> {
run_item_main_thread!(self, move |self_: Self| {
#[cfg(target_os = "macos")]
if let Ok(view) = window.ns_view() {
self_
.inner()
.show_context_menu_for_nsview(view as _, position);
unsafe {
self_
.inner()
.show_context_menu_for_nsview(view as _, position);
}
}
#[cfg(any(
@ -64,9 +66,11 @@ impl<R: Runtime> ContextMenuBase for Menu<R> {
#[cfg(windows)]
if let Ok(hwnd) = window.hwnd() {
self_
.inner()
.show_context_menu_for_hwnd(hwnd.0 as _, position)
unsafe {
self_
.inner()
.show_context_menu_for_hwnd(hwnd.0 as _, position)
}
}
})
}

View File

@ -36,9 +36,11 @@ impl<R: Runtime> ContextMenuBase for Submenu<R> {
run_item_main_thread!(self, move |self_: Self| {
#[cfg(target_os = "macos")]
if let Ok(view) = window.ns_view() {
self_
.inner()
.show_context_menu_for_nsview(view as _, position);
unsafe {
self_
.inner()
.show_context_menu_for_nsview(view as _, position);
}
}
#[cfg(any(
@ -56,9 +58,11 @@ impl<R: Runtime> ContextMenuBase for Submenu<R> {
#[cfg(windows)]
if let Ok(hwnd) = window.hwnd() {
self_
.inner()
.show_context_menu_for_hwnd(hwnd.0 as _, position)
unsafe {
self_
.inner()
.show_context_menu_for_hwnd(hwnd.0 as _, position)
}
}
})
}

View File

@ -1142,7 +1142,7 @@ tauri::Builder::default()
.map(crate::menu::map_to_menu_theme)
.unwrap_or(muda::MenuTheme::Auto);
let _ = menu_.inner().init_for_hwnd_with_theme(hwnd.0 as _, theme);
let _ = unsafe { menu_.inner().init_for_hwnd_with_theme(hwnd.0 as _, theme) };
}
#[cfg(any(
target_os = "linux",
@ -1183,7 +1183,7 @@ tauri::Builder::default()
self.run_on_main_thread(move || {
#[cfg(windows)]
if let Ok(hwnd) = window.hwnd() {
let _ = menu.inner().remove_for_hwnd(hwnd.0 as _);
let _ = unsafe { menu.inner().remove_for_hwnd(hwnd.0 as _) };
}
#[cfg(any(
target_os = "linux",
@ -1215,7 +1215,7 @@ tauri::Builder::default()
self.run_on_main_thread(move || {
#[cfg(windows)]
if let Ok(hwnd) = window.hwnd() {
let _ = menu_.inner().hide_for_hwnd(hwnd.0 as _);
let _ = unsafe { menu_.inner().hide_for_hwnd(hwnd.0 as _) };
}
#[cfg(any(
target_os = "linux",
@ -1243,7 +1243,7 @@ tauri::Builder::default()
self.run_on_main_thread(move || {
#[cfg(windows)]
if let Ok(hwnd) = window.hwnd() {
let _ = menu_.inner().show_for_hwnd(hwnd.0 as _);
let _ = unsafe { menu_.inner().show_for_hwnd(hwnd.0 as _) };
}
#[cfg(any(
target_os = "linux",
@ -1272,7 +1272,7 @@ tauri::Builder::default()
self.run_on_main_thread(move || {
#[cfg(windows)]
if let Ok(hwnd) = window.hwnd() {
let _ = tx.send(menu_.inner().is_visible_on_hwnd(hwnd.0 as _));
let _ = tx.send(unsafe { menu_.inner().is_visible_on_hwnd(hwnd.0 as _) });
}
#[cfg(any(
target_os = "linux",