Skip to content

Commit

Permalink
fix(macos): properly remove menu (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Aug 3, 2023
1 parent 9b2185a commit 22956ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/fix-macos-menu-remove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"muda": patch
---

Fix `remove_for_nsapp` not working.
2 changes: 1 addition & 1 deletion src/platform_impl/macos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Position>) {
Expand Down

0 comments on commit 22956ec

Please sign in to comment.