Disable Media Keys with MediaSession on Windows#1207
Merged
jeffvli merged 1 commit intojeffvli:developmentfrom Oct 22, 2025
Merged
Disable Media Keys with MediaSession on Windows#1207jeffvli merged 1 commit intojeffvli:developmentfrom
jeffvli merged 1 commit intojeffvli:developmentfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
1 task
139402a to
05fe607
Compare
05fe607 to
7e17e1b
Compare
7e17e1b to
13b0165
Compare
13b0165 to
03d41ef
Compare
03d41ef to
dab358d
Compare
dab358d to
406b4ab
Compare
406b4ab to
e7f809f
Compare
Contributor
Author
|
Just like the kids in school Lint didn't wanna play ball with me, but we made it... Should work now. Since the |
e7f809f to
7380a9a
Compare
ENDlezZenith
suggested changes
Oct 21, 2025
src/renderer/features/settings/components/hotkeys/window-hotkey-settings.tsx
Outdated
Show resolved
Hide resolved
src/renderer/features/settings/components/hotkeys/window-hotkey-settings.tsx
Outdated
Show resolved
Hide resolved
src/renderer/features/settings/components/hotkeys/window-hotkey-settings.tsx
Outdated
Show resolved
Hide resolved
ENDlezZenith
suggested changes
Oct 21, 2025
src/renderer/features/settings/components/hotkeys/window-hotkey-settings.tsx
Outdated
Show resolved
Hide resolved
7380a9a to
33182d4
Compare
33182d4 to
94f8032
Compare
HardwareMediaKeyHandling
jeffvli
reviewed
Oct 21, 2025
94f8032 to
867c4e2
Compare
867c4e2 to
a267cef
Compare
jeffvli
reviewed
Oct 22, 2025
In f07393c we enabled the MediaSession API, which from Chromium's side brings its own native way of handling Global Media Keys. However, it turns out having this enabled seemingly conflicts with Windows 11's SMTC implementation when we also bind the Media Keys using Electron's Global Hotkeys API (Windows 10 is apparently fine, but now EOL). Globally passing `HardwareMediaKeyHandling` to `disable-features` was considered, however using the MediaSession API requires `HardwareMediaKeyHandling` to be enabled, so this is not an option. Instead, with MediaSession enabled we need to let Chromium handle the Media Keys, while without MediaSession we bind our own Global Hot Keys for users that have them enabled in the settings. Co-Authored-By: Xudong Zhou <godzmichael@outlook.com>
a267cef to
5836304
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In f07393c we enabled the MediaSession API, which from Chromium's side brings its own native way of handling Global Media Keys. However, it turns out having this enabled seemingly conflicts with Windows 11's SMTC implementation when we also bind the Media Keys using Electron's Global Hotkeys API (Windows 10 is apparently fine, but now EOL).
Globally passing
HardwareMediaKeyHandlingtodisable-featureswas considered, however using the MediaSession API requiresHardwareMediaKeyHandlingto be enabled, so this is not an option.Instead, with MediaSession enabled we need to let Chromium handle the Media Keys, while without MediaSession we bind our own Global Hot Keys for users that have them enabled in the settings.
Fixes #1189
Previous Fix attempt for posterity
In f07393c this was gated behind whether or not the mediaSession API was enabled. However, it turns out having this enabled seemingly conflicts with Windows 11's SMTC implementation and/or Electron's global hotkey API.
So instead we always pass
HardwareMediaKeyHandlinglike we used to, and only make theMediaSessionServiceconditional.Note: Untested because I don't have a Windows install, but given that it was passed for the past 2+ years, it should be fine.