From 8fe71e3dc8752bc5235ae390a4d0b4fabf7039a2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 13 Jan 2022 16:02:29 +0530 Subject: [PATCH] Dont use a block for dictionary enumeration Maybe that will fix the mysterious issue @page-down is having --- glfw/cocoa_init.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glfw/cocoa_init.m b/glfw/cocoa_init.m index 3b4e72f08..43f5d0c31 100644 --- a/glfw/cocoa_init.m +++ b/glfw/cocoa_init.m @@ -520,10 +520,10 @@ build_global_shortcuts_lookup(void) { NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithCapacity:128]; // will be autoreleased NSDictionary *apple_settings = [[NSUserDefaults standardUserDefaults] persistentDomainForName:@"com.apple.symbolichotkeys"]; if (apple_settings) { - NSDictionary *symbolic_hotkeys = [apple_settings objectForKey:@"AppleSymbolicHotKeys"]; + NSDictionary *symbolic_hotkeys = [apple_settings objectForKey:@"AppleSymbolicHotKeys"]; if (symbolic_hotkeys) { - [symbolic_hotkeys enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - (void)stop; + for (NSString *key in symbolic_hotkeys) { + id obj = symbolic_hotkeys[key]; if ([key isKindOfClass:[NSString class]] && [obj isKindOfClass:[NSDictionary class]]) { NSInteger sc = [(NSString*)key integerValue]; NSDictionary *sc_value = obj; @@ -545,7 +545,7 @@ build_global_shortcuts_lookup(void) { } else snprintf(buf, sizeof(buf) - 1, "c:%lx:%ld", (unsigned long)mods, (long)ch); temp[@(buf)] = @(sc); } - }]; + }; } } global_shortcuts = [[NSDictionary dictionaryWithDictionary:temp] retain];