Repository navigation
Conversation
Chromium 148 (CL 7682308), shipped in Electron 42, added a mute button to the video Picture-in-Picture window and positioned it relative to the live caption button. picture-in-picture.patch compiles the live caption code out with #if 0, and the mute button's SetPosition() call sits inside that same block. The button was still created, since media::kPictureInPictureMuteControl is enabled by default, but it was never positioned. It stayed at (0,0), on top of the favicon and source title. Close the #if 0 block before the live caption code and position the mute button in the slot the live caption button would have used, at the trailing edge of the bottom controls. Views mirrors it to the bottom-left in right-to-left locales. Add a testing-only getVideoPictureInPictureLayoutForTesting() binding that returns the logical bounds of the window's controls, and a spec that checks the mute button is on the bottom row at the trailing edge, below the source title. The spec fails without the fix (the button is at x = 0) and passes with it. Fixes electron#56006 Assisted-By: Claude Opus 5.5, Claude Code
twilco
marked this pull request as draft
November 28, 2026 19:48
twilco
marked this pull request as ready for review
November 28, 2026 19:55
Contributor
Author
|
Sorry @dsanders11, just noticed that you had assigned #56006 to yourself. Happy to close this PR if you'd prefer to fix this yourself! |
Assisted-By: Claude Opus 5.5, Claude Code
This branch has not been deployed
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.
Description of Change
Since Electron 42, the mute button in the video Picture-in-Picture window (
HTMLVideoElement.requestPictureInPicture()) is drawn at the top-left corner, on top of the favicon and the source title. Like in Chrome, it should be on the bottom row next to the timestamp, at the bottom-right in left-to-right layouts and at the bottom-left in right-to-left layouts.Cause
Chromium 148 (CL 7682308) added a mute button to the video PiP window and positioned it relative to the live caption button.
picture-in-picture.patchcompiles the live caption code inVideoOverlayWindowViews::OnUpdateControlsBounds()out with#if 0, and the mute button'sSetPosition()call sits inside that same block. The button is still created, sincemedia::kPictureInPictureMuteControlis enabled by default, but it never gets a position and stays at (0,0).Fix
The
#if 0block now closes before the live caption code, and the mute button is placed in the slot the live caption button would have used, at the trailing edge of the bottom controls. The rest of the live status and live caption code stays compiled out. Views mirrors the layout automatically, so the right-to-left placement needs no extra handling.The only change to
fix_move_autopipsettingshelper_behind_branding_buildflag.patchis new index hashes and line numbers, because it edits the same file afterpicture-in-picture.patch.Test
A new spec,
places the mute button at the trailing edge of the bottom controls, opens a video PiP window and reads the window's layout through a new testing-only binding,getVideoPictureInPictureLayoutForTesting(). It checks that the mute button is on the bottom row at the trailing edge and below the source title. The binding returns logical (unmirrored) bounds, so the check holds in right-to-left locales too. Without the fix the spec fails (expected 0 to be greater than 247: the button is at x = 0). With the fix it passes, as does the existing PiP spec.Manual verification
Unfixed
main(top row) andmainplus this fix (bottom row), each in an LTR (en-US) and an RTL (he) locale:pip-mute-button-position-fix.mp4
Checklist
npm testpassesThis PR fixes #56006.
Assisted-By: Claude Opus 5.5, Claude Code
Release Notes
Notes: Fixed the video Picture-in-Picture mute button being drawn over the window title.