Skip to content

Commit d369e8d

Browse files
authored
chore(deps): update muda to 0.15 and tray-icon to 0.18 (#11097)
1 parent 28169ae commit d369e8d

File tree

6 files changed

+35
-26
lines changed

6 files changed

+35
-26
lines changed

Cargo.lock

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/tauri/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ specta = { version = "^2.0.0-rc.16", optional = true, default-features = false,
9191
] }
9292

9393
[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]
94-
muda = { version = "0.14", default-features = false, features = ["serde"] }
95-
tray-icon = { version = "0.17", default-features = false, features = [
94+
muda = { version = "0.15", default-features = false, features = ["serde"] }
95+
tray-icon = { version = "0.18", default-features = false, features = [
9696
"serde",
9797
], optional = true }
9898

crates/tauri/src/manager/menu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl<R: Runtime> MenuManager<R> {
7676
let theme = theme
7777
.map(crate::menu::map_to_menu_theme)
7878
.unwrap_or(muda::MenuTheme::Auto);
79-
let _ = menu.inner().init_for_hwnd_with_theme(raw.hwnd as _, theme);
79+
let _ = unsafe { menu.inner().init_for_hwnd_with_theme(raw.hwnd as _, theme) };
8080
}
8181
#[cfg(any(
8282
target_os = "linux",

crates/tauri/src/menu/menu.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ impl<R: Runtime> ContextMenuBase for Menu<R> {
4444
run_item_main_thread!(self, move |self_: Self| {
4545
#[cfg(target_os = "macos")]
4646
if let Ok(view) = window.ns_view() {
47-
self_
48-
.inner()
49-
.show_context_menu_for_nsview(view as _, position);
47+
unsafe {
48+
self_
49+
.inner()
50+
.show_context_menu_for_nsview(view as _, position);
51+
}
5052
}
5153

5254
#[cfg(any(
@@ -64,9 +66,11 @@ impl<R: Runtime> ContextMenuBase for Menu<R> {
6466

6567
#[cfg(windows)]
6668
if let Ok(hwnd) = window.hwnd() {
67-
self_
68-
.inner()
69-
.show_context_menu_for_hwnd(hwnd.0 as _, position)
69+
unsafe {
70+
self_
71+
.inner()
72+
.show_context_menu_for_hwnd(hwnd.0 as _, position)
73+
}
7074
}
7175
})
7276
}

crates/tauri/src/menu/submenu.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ impl<R: Runtime> ContextMenuBase for Submenu<R> {
3636
run_item_main_thread!(self, move |self_: Self| {
3737
#[cfg(target_os = "macos")]
3838
if let Ok(view) = window.ns_view() {
39-
self_
40-
.inner()
41-
.show_context_menu_for_nsview(view as _, position);
39+
unsafe {
40+
self_
41+
.inner()
42+
.show_context_menu_for_nsview(view as _, position);
43+
}
4244
}
4345

4446
#[cfg(any(
@@ -56,9 +58,11 @@ impl<R: Runtime> ContextMenuBase for Submenu<R> {
5658

5759
#[cfg(windows)]
5860
if let Ok(hwnd) = window.hwnd() {
59-
self_
60-
.inner()
61-
.show_context_menu_for_hwnd(hwnd.0 as _, position)
61+
unsafe {
62+
self_
63+
.inner()
64+
.show_context_menu_for_hwnd(hwnd.0 as _, position)
65+
}
6266
}
6367
})
6468
}

crates/tauri/src/window/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ tauri::Builder::default()
11421142
.map(crate::menu::map_to_menu_theme)
11431143
.unwrap_or(muda::MenuTheme::Auto);
11441144

1145-
let _ = menu_.inner().init_for_hwnd_with_theme(hwnd.0 as _, theme);
1145+
let _ = unsafe { menu_.inner().init_for_hwnd_with_theme(hwnd.0 as _, theme) };
11461146
}
11471147
#[cfg(any(
11481148
target_os = "linux",
@@ -1183,7 +1183,7 @@ tauri::Builder::default()
11831183
self.run_on_main_thread(move || {
11841184
#[cfg(windows)]
11851185
if let Ok(hwnd) = window.hwnd() {
1186-
let _ = menu.inner().remove_for_hwnd(hwnd.0 as _);
1186+
let _ = unsafe { menu.inner().remove_for_hwnd(hwnd.0 as _) };
11871187
}
11881188
#[cfg(any(
11891189
target_os = "linux",
@@ -1215,7 +1215,7 @@ tauri::Builder::default()
12151215
self.run_on_main_thread(move || {
12161216
#[cfg(windows)]
12171217
if let Ok(hwnd) = window.hwnd() {
1218-
let _ = menu_.inner().hide_for_hwnd(hwnd.0 as _);
1218+
let _ = unsafe { menu_.inner().hide_for_hwnd(hwnd.0 as _) };
12191219
}
12201220
#[cfg(any(
12211221
target_os = "linux",
@@ -1243,7 +1243,7 @@ tauri::Builder::default()
12431243
self.run_on_main_thread(move || {
12441244
#[cfg(windows)]
12451245
if let Ok(hwnd) = window.hwnd() {
1246-
let _ = menu_.inner().show_for_hwnd(hwnd.0 as _);
1246+
let _ = unsafe { menu_.inner().show_for_hwnd(hwnd.0 as _) };
12471247
}
12481248
#[cfg(any(
12491249
target_os = "linux",
@@ -1272,7 +1272,7 @@ tauri::Builder::default()
12721272
self.run_on_main_thread(move || {
12731273
#[cfg(windows)]
12741274
if let Ok(hwnd) = window.hwnd() {
1275-
let _ = tx.send(menu_.inner().is_visible_on_hwnd(hwnd.0 as _));
1275+
let _ = tx.send(unsafe { menu_.inner().is_visible_on_hwnd(hwnd.0 as _) });
12761276
}
12771277
#[cfg(any(
12781278
target_os = "linux",

0 commit comments

Comments
 (0)