[Bug]: FATAL error with generating shortcut text for super accelerator (Linux)
Preflight Checklist
- [x] I have read the Contributing Guidelines for this project.
- [x] I agree to follow the Code of Conduct that this project adheres to.
- [x] I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
32.x
What operating system(s) are you using?
Ubuntu
Operating System Version
24.04
What arch are you using?
x64
Last Known Working Electron version
31.x
Expected Behavior
Should not crash for supported accelerators.
Actual Behavior
FATAL error due to missing shortcut text in the runtime https://source.chromium.org/chromium/chromium/src/+/main:ui/base/accelerators/accelerator.cc;l=413
Testcase Gist URL
https://gist.github.com/deepak1556/d02d2b2255f5f1c0b9d0a515891b461c
Additional Information
This is extracted from https://github.com/microsoft/vscode/issues/230604, Chromium is in the process of making NOTREACHED as fatal refs https://issues.chromium.org/issues/40580068, the relevant changes have landed since Electron 32.
Although Electron supports the Super modifier https://github.com/electron/electron/blob/main/docs/api/accelerator.md#platform-notice we haven't updated the shortcut text in ui::Accelerator::ApplyLongFormModifiers which results in unexpected crash.
The original condition on macOS was added in https://codereview.chromium.org/718803003 and windows support was added in https://chromium-review.googlesource.com/c/chromium/src/+/1235220. Seems like the text was added on a requirement basis. I will suggest a CL as next step, if that fails we should float a patch in Electron.
@deepak1556 to clarify - what should this be mapping to? Also IDS_APP_WINDOWS_KEY?
It should match to the user specified name (either Super or Meta) at the time of creating the accelerator.
The Super (or Meta) key is mapped to the Windows key on Windows and Linux and Cmd on macOS.