electron icon indicating copy to clipboard operation
electron copied to clipboard

[Bug]: FATAL error with generating shortcut text for super accelerator (Linux)

Open deepak1556 opened this issue 1 year ago • 3 comments

Preflight Checklist

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.

deepak1556 avatar Oct 11 '24 12:10 deepak1556

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 avatar Oct 11 '24 13:10 deepak1556

@deepak1556 to clarify - what should this be mapping to? Also IDS_APP_WINDOWS_KEY?

codebytere avatar Oct 14 '24 09:10 codebytere

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.

deepak1556 avatar Oct 14 '24 11:10 deepak1556