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: MediaKey globalShortcuts not working on macOS #21442

Merged
merged 1 commit into from Dec 11, 2019
Merged

Conversation

@codebytere
Copy link
Member

codebytere commented Dec 9, 2019

Description of Change

Closes #20788.

This PR overrides MediaKeysListener::IsMediaKeycode to also listen for VolumeUp, VolumeDown, and VolumeMute.

We also need to patch out Chromium's usage of RemoteCommandCenterDelegate, as it uses MPRemoteCommandCenter in a change added in this CL. MPRemoteCommandCenter makes it such that globalShortcuts 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 of globalShortcuts.

Checklist

Release Notes

Notes: Fixed media-specific globalShortcuts not working on macOS.

@codebytere codebytere requested a review from electron/wg-upgrades as a code owner Dec 9, 2019
@codebytere codebytere requested review from deepak1556, nornagon and zcbenz Dec 9, 2019
+// `ui::Accelerator`, rather than `extensions::Command`.
+
+// static
+bool Command::IsMediaKey(const ui::Accelerator& accelerator) {

This comment has been minimized.

Copy link
@codebytere

codebytere Dec 9, 2019

Author Member

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.

@codebytere codebytere force-pushed the fix-media-shortcuts branch from bf48e79 to fb08815 Dec 9, 2019
@codebytere codebytere requested a review from deepak1556 Dec 9, 2019
Copy link
Member

deepak1556 left a comment

👍

@codebytere codebytere force-pushed the fix-media-shortcuts branch from fb08815 to 90ac259 Dec 10, 2019
@electron-cation electron-cation bot removed the new-pr 🌱 label Dec 10, 2019
@codebytere codebytere force-pushed the fix-media-shortcuts branch 2 times, most recently from f1b21ed to 8d51e81 Dec 10, 2019
@codebytere codebytere force-pushed the fix-media-shortcuts branch from 8d51e81 to 7571738 Dec 11, 2019
@zcbenz
zcbenz approved these changes Dec 11, 2019
@zcbenz zcbenz merged commit cbe1e3a into master Dec 11, 2019
19 of 21 checks passed
19 of 21 checks passed
electron-woa-testing Build #20191211.12 failed
Details
electron-woa-testing #20191211.12 failed
Details
Backportable? - 6-1-x Backport Failed
Details
Backportable? - 7-1-x Backport Failed
Details
Backportable? - 8-x-y Backport Failed
Details
Artifact Comparison No Changes
Details
Semantic Pull Request ready to be squashed
Details
WIP Ready for review
Details
appveyor: win-ia32-testing AppVeyor build succeeded
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-woa-testing AppVeyor build succeeded
Details
appveyor: win-x64-testing AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
build-linux Workflow: build-linux
Details
build-mac Workflow: build-mac
Details
electron-arm-testing Build #20191211.5 succeeded
Details
electron-arm-testing #20191211.5 succeeded
Details
electron-arm64-testing Build #20191211.6 succeeded
Details
electron-arm64-testing #20191211.6 succeeded
Details
lint Workflow: lint
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

release-clerk bot commented Dec 11, 2019

Release Notes Persisted

Fixed media-specific globalShortcuts not working on macOS.

@zcbenz zcbenz deleted the fix-media-shortcuts branch Dec 11, 2019
@trop

This comment has been minimized.

Copy link
Contributor

trop bot commented Dec 11, 2019

I was unable to backport this PR to "6-1-x" cleanly;
you will need to perform this backport manually.

@trop trop bot removed the target/6-1-x label Dec 11, 2019
@trop

This comment has been minimized.

Copy link
Contributor

trop bot commented Dec 11, 2019

I was unable to backport this PR to "7-1-x" cleanly;
you will need to perform this backport manually.

@trop trop bot added needs-manual-bp/6-1-x and removed target/7-1-x labels Dec 11, 2019
@trop

This comment has been minimized.

Copy link
Contributor

trop bot commented Dec 11, 2019

I was unable to backport this PR to "8-x-y" cleanly;
you will need to perform this backport manually.

@trop

This comment has been minimized.

Copy link
Contributor

trop bot commented Dec 16, 2019

@codebytere has manually backported this PR to "8-x-y", please check out #21547

@trop

This comment has been minimized.

Copy link
Contributor

trop bot commented Dec 16, 2019

@codebytere has manually backported this PR to "7-1-x", please check out #21548

@trop

This comment has been minimized.

Copy link
Contributor

trop bot commented Jan 7, 2020

@codebytere has manually backported this PR to "6-1-x", please check out #21690

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.