diff --git a/crates/eframe/src/native/app_icon.rs b/crates/eframe/src/native/app_icon.rs index 031a62e5fea..59bb5a0ec83 100644 --- a/crates/eframe/src/native/app_icon.rs +++ b/crates/eframe/src/native/app_icon.rs @@ -3,6 +3,7 @@ //! TODO(emilk): port this to [`winit`]. use std::sync::Arc; +use cocoa::appkit::NSEventModifierFlags; use egui::IconData; @@ -267,7 +268,7 @@ fn set_title_and_icon_mac(_title: &str, icon_data: Option<&IconData>) -> AppIcon let hide_prefix = NSString::alloc(nil).init_str("Hide "); let hide_title = hide_prefix.stringByAppendingString_(NSProcessInfo::processInfo(nil).processName()); - let hide_action = selector("hideApp:"); + let hide_action = selector("hide:"); let hide_key = NSString::alloc(nil).init_str("h"); let hide_item = NSMenuItem::alloc(nil) .initWithTitle_action_keyEquivalent_(hide_title, hide_action, hide_key) @@ -275,19 +276,16 @@ fn set_title_and_icon_mac(_title: &str, icon_data: Option<&IconData>) -> AppIcon app_menu.addItem_(hide_item); let hide_others_title = NSString::alloc(nil).init_str("Hide Others"); - let hide_others_action = selector("hideOthers:"); - let hide_others_key = NSString::alloc(nil).init_str(""); + let hide_others_action = selector("hideOtherApplications:"); + let hide_others_key = NSString::alloc(nil).init_str("h"); let hide_others_item = NSMenuItem::alloc(nil) - .initWithTitle_action_keyEquivalent_( - hide_others_title, - hide_others_action, - hide_others_key, - ) + .initWithTitle_action_keyEquivalent_(hide_others_title, hide_others_action, hide_others_key) .autorelease(); + hide_others_item.setKeyEquivalentModifierMask_(NSEventModifierFlags::NSCommandKeyMask | NSEventModifierFlags::NSAlternateKeyMask); app_menu.addItem_(hide_others_item); let show_all_title = NSString::alloc(nil).init_str("Show All"); - let show_all_action = selector("showAll:"); + let show_all_action = selector("unhideAllApplications:"); let show_all_key = NSString::alloc(nil).init_str(""); let show_all_item = NSMenuItem::alloc(nil) .initWithTitle_action_keyEquivalent_(show_all_title, show_all_action, show_all_key)