emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 4e20c8f: Fix menu keyboard shortcuts on macOS (Bu


From: Alan Third
Subject: [Emacs-diffs] emacs-26 4e20c8f: Fix menu keyboard shortcuts on macOS (Bug#29595)
Date: Mon, 1 Jan 2018 08:46:46 -0500 (EST)

branch: emacs-26
commit 4e20c8f22031d6f19e70f0dfcb11c09606446d88
Author: Alan Third <address@hidden>
Commit: Alan Third <address@hidden>

    Fix menu keyboard shortcuts on macOS (Bug#29595)
    
    * src/nsmenu.m (addItemWithWidgetValue)[NS_IMPL_COCOA]: It looks like
    macOS 10.13 no longer ignores long modifier strings, so explicitly use
    an empty string.
---
 src/nsmenu.m | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/nsmenu.m b/src/nsmenu.m
index 20b4e58..604adcf 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -643,14 +643,23 @@ x_activate_menubar (struct frame *f)
 
       keyEq = [self parseKeyEquiv: wv->key];
 #ifdef NS_IMPL_COCOA
-      /* macOS just ignores modifier strings longer than one character */
+      /* macOS mangles modifier strings longer than one character.  */
       if (keyEquivModMask == 0)
-        title = [title stringByAppendingFormat: @" (%@)", keyEq];
+        {
+          title = [title stringByAppendingFormat: @" (%@)", keyEq];
+          item = [self addItemWithTitle: (NSString *)title
+                                 action: @selector (menuDown:)
+                          keyEquivalent: @""];
+        }
+      else
+        {
+#endif
+          item = [self addItemWithTitle: (NSString *)title
+                                 action: @selector (menuDown:)
+                          keyEquivalent: keyEq];
+#ifdef NS_IMPL_COCOA
+        }
 #endif
-
-      item = [self addItemWithTitle: (NSString *)title
-                             action: @selector (menuDown:)
-                      keyEquivalent: keyEq];
       [item setKeyEquivalentModifierMask: keyEquivModMask];
 
       [item setEnabled: wv->enabled];



reply via email to

[Prev in Thread] Current Thread [Next in Thread]