twilco

#56089: fix: position the video Picture-in-Picture mute button

Merged
Created: Nov 28, 2026, 1:48:02 PM
Merged: Dec 1, 2026, 4:26:18 PM
5 comments
Target: main

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.patch compiles the live caption code in VideoOverlayWindowViews::OnUpdateControlsBounds() out with #if 0, and the mute button's SetPosition() call sits inside that same block. The button is still created, since media::kPictureInPictureMuteControl is enabled by default, but it never gets a position and stays at (0,0).

Fix

The #if 0 block 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.patch is new index hashes and line numbers, because it edits the same file after picture-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) and main plus this fix (bottom row), each in an LTR (en-US) and an RTL (he) locale:

pip-mute-button-position-fix.mp4

Checklist

This 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.

Backports

44-x-y
Pending
Waiting for a manual backport
45-x-y
Pending
Waiting for a manual backport
46-x-y
In-flight
PR Number
#56136
Waiting to be merged

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron