From 0e83367a2bd036a9ef5fc13beac92b9efa598f2e Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Sat, 22 Jul 2023 13:36:52 +0200 Subject: [PATCH] Force shortcuts to show in context menus on macOS (#4722) Co-authored-by: Rasmus Karlsson --- CHANGELOG.md | 1 + src/RunGui.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20a4c8f5bd7..e316459e3e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - Bugfix: Fixed partially broken filters on Qt 6 builds. (#4702) - Bugfix: Fixed some network errors having `0` as their HTTP status. (#4704) - Bugfix: Fixed crash that could occurr when closing the usercard too quickly after blocking or unblocking a user. (#4711) +- Bugfix: Fixed key bindings not showing in context menus on Mac. (#4722) - Dev: Added command to set Qt's logging filter/rules at runtime (`/c2-set-logging-rules`). (#4637) - Dev: Added the ability to see & load custom themes from the Themes directory. No stable promises are made of this feature, changes might be made that breaks custom themes without notice. (#4570) - Dev: Added test cases for emote and tab completion. (#4644) diff --git a/src/RunGui.cpp b/src/RunGui.cpp index 6d903bb452f..ce36d7a9114 100644 --- a/src/RunGui.cpp +++ b/src/RunGui.cpp @@ -86,6 +86,13 @@ namespace { QApplication::setWindowIcon(QIcon(":/icon.ico")); #endif +#ifdef Q_OS_MAC + // On the Mac/Cocoa platform this attribute is enabled by default + // We override it to ensure shortcuts show in context menus on that platform + QApplication::setAttribute(Qt::AA_DontShowShortcutsInContextMenus, + false); +#endif + installCustomPalette(); }