mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-09-20 05:30:25 +02:00
@@ -0,0 +1,55 @@
|
||||
From 00e1f2fb40434c9e7fcdb746ce72cd03cb07e3f2 Mon Sep 17 00:00:00 2001
|
||||
From: LibreWolf Developers <noreply@librewolf.net>
|
||||
Date: Sun, 6 Sep 2026 10:10:48 +0100
|
||||
Subject: [PATCH 25/52] pip-hide.patch
|
||||
|
||||
---
|
||||
.../pictureinpicture/PictureInPicture.sys.mjs | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
diff --git a/toolkit/components/pictureinpicture/PictureInPicture.sys.mjs b/toolkit/components/pictureinpicture/PictureInPicture.sys.mjs
|
||||
index 6aca1f73281c..5225e05e7a38 100644
|
||||
--- a/toolkit/components/pictureinpicture/PictureInPicture.sys.mjs
|
||||
+++ b/toolkit/components/pictureinpicture/PictureInPicture.sys.mjs
|
||||
@@ -121,6 +121,15 @@ export class PictureInPictureToggleParent extends JSWindowActorParent {
|
||||
if (!lazy.PIP_ENABLED || !lazy.PIP_WHEN_SWITCHING_TABS) {
|
||||
break;
|
||||
}
|
||||
+
|
||||
+ // Suppress auto-toggle if the user deliberately closed this PiP window
|
||||
+ if (
|
||||
+ PictureInPicture.weakAutoPipBrowserClosedDeliberately.has(browser)
|
||||
+ ) {
|
||||
+ PictureInPicture.weakAutoPipBrowserClosedDeliberately.delete(browser);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
// If the tab is still selected, then we can ignore this event
|
||||
if (browser.documentGlobal.gBrowser.selectedBrowser == browser) {
|
||||
break;
|
||||
@@ -263,6 +272,8 @@ export var PictureInPicture = {
|
||||
// Maps auto pip browser to PictureInPictureParent actor
|
||||
weakAutoPipBrowserToParent: new WeakMap(),
|
||||
|
||||
+ weakAutoPipBrowserClosedDeliberately: new WeakSet(),
|
||||
+
|
||||
/**
|
||||
* Returns the player window if one exists and if it hasn't yet been closed.
|
||||
*
|
||||
@@ -901,6 +912,13 @@ export var PictureInPicture = {
|
||||
if (!win) {
|
||||
return;
|
||||
}
|
||||
+
|
||||
+ const browser = this.weakWinToBrowser.get(win);
|
||||
+
|
||||
+ if (reason === "CloseButton") {
|
||||
+ PictureInPicture.weakAutoPipBrowserClosedDeliberately.add(browser);
|
||||
+ }
|
||||
+
|
||||
this.removePiPBrowserFromWeakMap(this.weakWinToBrowser.get(win));
|
||||
this.weakAutoPipBrowserToParent.delete(this.weakWinToBrowser.get(win));
|
||||
|
||||
--
|
||||
2.47.3
|
||||
|
||||
Reference in New Issue
Block a user