summaryrefslogtreecommitdiff
path: root/src/ui/bindingswidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-11-14 18:34:20 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-11-14 18:34:20 +0200
commitb55c5d8e93c5239d77e9afc1e15b2c7e9449d40e (patch)
tree33101f466bfe802bb03b5b9be9a6ed665523a87d /src/ui/bindingswidget.c
parentc11e09353ba7558f15958a01a0a4ac8f704d1ba5 (diff)
macOS: Disable menu shortcuts while binding keys
Diffstat (limited to 'src/ui/bindingswidget.c')
-rw-r--r--src/ui/bindingswidget.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ui/bindingswidget.c b/src/ui/bindingswidget.c
index 23fbbe88..a6e9f6a0 100644
--- a/src/ui/bindingswidget.c
+++ b/src/ui/bindingswidget.c
@@ -26,6 +26,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
26#include "command.h" 26#include "command.h"
27#include "util.h" 27#include "util.h"
28#include "app.h" 28#include "app.h"
29#if defined (iPlatformApple)
30# include "macos.h"
31#endif
29 32
30iDeclareType(BindingItem) 33iDeclareType(BindingItem)
31typedef iListItemClass iBindingItemClass; 34typedef iListItemClass iBindingItemClass;
@@ -129,6 +132,13 @@ static void setActiveItem_BindingsWidget_(iBindingsWidget *d, size_t pos) {
129 item->isWaitingForEvent = iTrue; 132 item->isWaitingForEvent = iTrue;
130 invalidateItem_ListWidget(d->list, d->activePos); 133 invalidateItem_ListWidget(d->list, d->activePos);
131 } 134 }
135#if defined (iPlatformApple)
136 /* Native menus must be disabled while grabbing keys so the shortcuts don't trigger. */
137 const iBool enableNativeMenus = (d->activePos == iInvalidPos);
138 enableMenu_MacOS("Edit", enableNativeMenus);
139 enableMenu_MacOS("View", enableNativeMenus);
140 enableMenu_MacOS("Identity", enableNativeMenus);
141#endif
132} 142}
133 143
134static iBool processEvent_BindingsWidget_(iBindingsWidget *d, const SDL_Event *ev) { 144static iBool processEvent_BindingsWidget_(iBindingsWidget *d, const SDL_Event *ev) {