Bug 1865494: Implement see-through video player mode r=emilio,mstange,desktop-theme-reviewers,pip-reviewers,mhowell

Implement experimental transparent-on-hover behavior for the
picture-in-picture video player. This makes the popup player less of
a nuisance on smaller displays.

Tested on macOS, but should also work on Windows with small tweaks.

The behavior is hidden behind a pref:
media.videocontrols.picture-in-picture.seethrough-mode.enabled

Differential Revision: https://phabricator.services.mozilla.com/D193993
This commit is contained in:
Vsevolod Buzinov
2023-11-30 18:33:41 +00:00
parent 772fdf6d14
commit c0dc7b94e6
5 changed files with 29 additions and 4 deletions

View File

@@ -11566,8 +11566,7 @@ void PresShell::SyncWindowProperties(bool aSync) {
widget::TransparencyMode mode = nsLayoutUtils::GetFrameTransparency(
canvas ? canvas : rootFrame, rootFrame);
StyleWindowShadow shadow = rootFrame->StyleUIReset()->mWindowShadow;
nsCOMPtr<nsIWidget> viewWidget = view->GetWidget();
viewWidget->SetTransparencyMode(mode);
windowWidget->SetTransparencyMode(mode);
windowWidget->SetWindowShadowStyle(shadow);
// For macOS, apply color scheme overrides to the top level window widget.