Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correctly display zoom in accelerator on mac #15502

merged 3 commits into from Nov 7, 2018
Changes from 1 commit
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.


Just for now

@@ -75,3 +75,4 @@ tts.patch
@@ -0,0 +1,28 @@
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
This conversation was marked as resolved by codebytere

This comment has been minimized.

Copy link

MarshallOfSound Oct 31, 2018


Can we add a note here which Chromium version we can remove this patch for 👍

diff --git a/ui/base/accelerators/ b/ui/base/accelerators/
index 9786168be893..3c177060453a 100644
--- a/ui/base/accelerators/
+++ b/ui/base/accelerators/
@@ -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;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.