Skip to content

Conversation

@mihawk90
Copy link
Contributor

@mihawk90 mihawk90 commented Oct 21, 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.

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 HardwareMediaKeyHandling like we used to, and only make the MediaSessionService conditional.


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.

@vercel
Copy link

vercel bot commented Oct 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
feishin Ready Ready Preview Comment Oct 22, 2025 4:32am

@mihawk90
Copy link
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 Global media hotkeys toggle effectively didn't do anything anymore with mediaSession enabled, the toggle is now disabled/hidden.
It is shown again when the feature is disabled.

Copy link
Contributor

@ENDlezZenith ENDlezZenith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check Review

@mihawk90 mihawk90 force-pushed the windows-smtc-mediakeys branch from e7f809f to 7380a9a Compare October 21, 2025 10:29
@mihawk90 mihawk90 force-pushed the windows-smtc-mediakeys branch from 7380a9a to 33182d4 Compare October 21, 2025 11:21
@mihawk90 mihawk90 force-pushed the windows-smtc-mediakeys branch from 33182d4 to 94f8032 Compare October 21, 2025 12:26
@mihawk90 mihawk90 changed the title Always disable HardwareMediaKeyHandling Disable Media Keys with MediaSession on Windows Oct 21, 2025
@mihawk90 mihawk90 force-pushed the windows-smtc-mediakeys branch from 94f8032 to 867c4e2 Compare October 22, 2025 00:42
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>
@mihawk90 mihawk90 force-pushed the windows-smtc-mediakeys branch from a267cef to 5836304 Compare October 22, 2025 04:31
@jeffvli jeffvli merged commit a9af1e9 into jeffvli:development Oct 22, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Windows 11 SMTC nonfunctional

3 participants