From 22956ec724673d21e1d6a675c536eff060737e02 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Thu, 3 Aug 2023 09:55:25 -0700 Subject: [PATCH] fix(macos): properly remove menu (#87) --- .changes/fix-macos-menu-remove.md | 5 +++++ src/platform_impl/macos/mod.rs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changes/fix-macos-menu-remove.md diff --git a/.changes/fix-macos-menu-remove.md b/.changes/fix-macos-menu-remove.md new file mode 100644 index 0000000..f3e3d0e --- /dev/null +++ b/.changes/fix-macos-menu-remove.md @@ -0,0 +1,5 @@ +--- +"muda": patch +--- + +Fix `remove_for_nsapp` not working. diff --git a/src/platform_impl/macos/mod.rs b/src/platform_impl/macos/mod.rs index a968690..fac7348 100644 --- a/src/platform_impl/macos/mod.rs +++ b/src/platform_impl/macos/mod.rs @@ -143,7 +143,7 @@ impl Menu { } pub fn remove_for_nsapp(&self) { - unsafe { NSApp().setMainMenu_(nil) } + unsafe { NSApp().setMainMenu_(NSMenu::new(nil) as _) } } pub fn show_context_menu_for_nsview(&self, view: id, position: Option) {