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: don't append Shift modifier text twice to accelerators #15400

Merged
merged 5 commits into from Oct 31, 2018

Conversation

brenca
Copy link
Contributor

@brenca brenca commented Oct 25, 2018

Description of Change

Fixes #15392. For some reason our patch applied a Shift modifier to a whole bunch of accelerator characters (like Backspace, but Tab and Enter were also affected), my best guess is that those used to be broken with Shift but now are working properly in chromium.

I'll backport this manually, trop couldn't deal with 4-0-x.

Checklist

  • PR description included and stakeholders cc'd
  • npm test passes
  • PR title follows semantic commit guidelines

Release Notes

Notes: fixed some accelerators having Shift appended to them twice

@@ -19,17 +19,17 @@ index 7e55ef366ac8320f730cdcb268453b1fa2710887..c3fb98b426cd7c12f66eaaf358f4ff18
@@ -21,9 +22,7 @@
#include <windows.h>
#endif

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those spaces are important, leave them in please! this patch should be exactly as exported by git-export-patches.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I knew there was something up with those spaces, gonna fix asap

@brenca brenca force-pushed the brenca/fix-shift-accelerators branch from 65559f0 to 55dabaf Compare October 29, 2018 15:34
@ckerr
Copy link
Member

ckerr commented Oct 30, 2018

@nornagon thoughts on the revised PR?

Copy link
Member

@nornagon nornagon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, I still want tests though :(

@brenca brenca force-pushed the brenca/fix-shift-accelerators branch from 55dabaf to 569e264 Compare October 30, 2018 16:30
@brenca
Copy link
Contributor Author

brenca commented Oct 30, 2018

@nornagon ask, and thou shall receive 🙇

@@ -155,6 +155,13 @@ base::string16 Menu::GetSublabelAt(int index) const {
return model_->GetSublabelAt(index);
}

base::string16 Menu::GetAcceleratorTextAt(int index) const {
auto* accelerator = new ui::Accelerator();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who owns this accelerator ? I don't see any explicit ownership claim in the code path, maybe I am missing something here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oooh, good catch! this should probably be on the stack.

Suggested change
auto* accelerator = new ui::Accelerator();
ui::Accelerator accelerator;
model_->GetAcceleratorAtWithParams(index, true, &accelerator);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Thanks for catching this

@brenca brenca force-pushed the brenca/fix-shift-accelerators branch from 976b4d1 to 880b9bb Compare October 30, 2018 18:30
@brenca brenca force-pushed the brenca/fix-shift-accelerators branch from 3a6c073 to 2b0e4be Compare October 30, 2018 21:26
@jkleinsc jkleinsc merged commit aa6f7a5 into master Oct 31, 2018
@release-clerk
Copy link

release-clerk bot commented Oct 31, 2018

Release Notes Persisted

fixed some accelerators having Shift appended to them twice

@jkleinsc jkleinsc deleted the brenca/fix-shift-accelerators branch October 31, 2018 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accelerator "Shift+Backspace" show as "Shift+Shift+Backspace" in menu
5 participants