Commit 4e20c8f2 authored by Alan Third's avatar Alan Third

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.
parent 30d6c313
......@@ -643,14 +643,23 @@ - (NSMenuItem *)addItemWithWidgetValue: (void *)wvptr
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];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment