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: MediaKey globalShortcuts not working on macOS #21442
Conversation
+// `ui::Accelerator`, rather than `extensions::Command`. | ||
+ | ||
+// static | ||
+bool Command::IsMediaKey(const ui::Accelerator& accelerator) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IsMediaKey
in Chromium now invokes IsMediaKeyCode
which is also used in other places, so it makes more sense to override there instead of at the IsMediaKey
level.
bf48e79
to
fb08815
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
fb08815
to
90ac259
Compare
f1b21ed
to
8d51e81
Compare
8d51e81
to
7571738
Compare
Release Notes Persisted
|
I was unable to backport this PR to "6-1-x" cleanly; |
I was unable to backport this PR to "7-1-x" cleanly; |
I was unable to backport this PR to "8-x-y" cleanly; |
@codebytere has manually backported this PR to "8-x-y", please check out #21547 |
@codebytere has manually backported this PR to "7-1-x", please check out #21548 |
@codebytere has manually backported this PR to "6-1-x", please check out #21690 |
Description of Change
Closes #20788.
This PR overrides
MediaKeysListener::IsMediaKeycode
to also listen forVolumeUp
,VolumeDown
, andVolumeMute
.We also need to patch out Chromium's usage of
RemoteCommandCenterDelegate
, as it usesMPRemoteCommandCenter
in a change added in this CL.MPRemoteCommandCenter
makes it such thatglobalShortcuts
in Electron will not work as intended, because by design an app does not receive remote control events until it begins playing audio. This means that a media shortcut would not kick into effect until you, for example, began playing a YouTube video which sort of defeats the purpose ofglobalShortcuts
.Checklist
npm test
passesRelease Notes
Notes: Fixed media-specific globalShortcuts not working on macOS.