diff --git a/patches/common/chromium/.patches b/patches/common/chromium/.patches index 0f36fbd99f67a..726afa8a82cc2 100644 --- a/patches/common/chromium/.patches +++ b/patches/common/chromium/.patches @@ -79,3 +79,4 @@ content_browser_main_loop.patch dump_syms.patch web_preferences.patch verbose_generate_breakpad_symbols.patch +fix_zoom_display.patch diff --git a/patches/common/chromium/fix_zoom_display.patch b/patches/common/chromium/fix_zoom_display.patch new file mode 100644 index 0000000000000..d868153762db7 --- /dev/null +++ b/patches/common/chromium/fix_zoom_display.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Web Oct 31 00:00:00 2001 +From: Shelley Vohr +Date: Web, 31 Oct 2018 09:08:02 -0700 +Subject: fix_zoom_display.patch + +Backport of https://chromium-review.googlesource.com/c/chromium/src/+/1157224. +This patch was released in 70.0.3512.0. + +diff --git a/ui/base/accelerators/platform_accelerator_cocoa.mm b/ui/base/accelerators/platform_accelerator_cocoa.mm +index 9786168be893..3c177060453a 100644 +--- a/ui/base/accelerators/platform_accelerator_cocoa.mm ++++ b/ui/base/accelerators/platform_accelerator_cocoa.mm +@@ -25,9 +25,16 @@ void GetKeyEquivalentAndModifierMaskFromAccelerator( + if (accelerator.IsCmdDown()) + cocoa_modifiers |= NSEventModifierFlagCommand; + unichar shifted_character; ++ unichar character; + int result = ui::MacKeyCodeForWindowsKeyCode( +- accelerator.key_code(), cocoa_modifiers, &shifted_character, nullptr); +- DCHECK(result != -1); ++ accelerator.key_code(), cocoa_modifiers, &shifted_character, &character); ++ DCHECK_NE(result, -1); ++ ++ // If the key equivalent is itself shifted, then drop Shift from the modifier ++ // flags, otherwise Shift will be required. E.g., curly braces and plus are ++ // both inherently shifted, so the key equivalents shouldn't require Shift. ++ if (shifted_character != character) ++ cocoa_modifiers &= ~NSEventModifierFlagShift; + *key_equivalent = [NSString stringWithFormat:@"%C", shifted_character]; + *modifier_mask = cocoa_modifiers; + }