Auto-open PiP on app switch
Categories
(Toolkit :: Picture-in-Picture, enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox159 | --- | fixed |
People
(Reporter: pannett, Assigned: rio.syed)
Details
Attachments
(3 external files, 1 obsolete file)
Love the new 'Auto-open PiP on tab switch' feature! ❤️
Is it possible to make it work on app-switch, too? 🤞
Following up from this Slack convo:
https://mozilla.slack.com/archives/C4D3JFF26/p1722945883378159
Updated•2 years ago
|
Comment 1•2 years ago
|
||
Updated•2 years ago
|
Comment 2•11 months ago
|
||
Hey Daniele, I wanted to check in and see if you were going to update your patch for this based on the comments! If not, I'd be happy to take a dab at this
Comment 3•10 months ago
|
||
Hi @Harshit,
I have no access to the Slack conversation, but I think I won't implement a feature to trigger the PiP window when switching app, as I have very limited time.
If you want, you can take it. :)
Comment 4•8 months ago
|
||
Taking over from Daniele, I'll start work on this soon!
Comment 5•8 months ago
|
||
Updated•5 months ago
|
Comment 7•5 months ago
|
||
Updated•5 months ago
|
I have a working implementation of the macOS side of this and wanted to offer
it rather than duplicate your WIP (attachment 9584516 [details]).
Today PictureInPicture:VideoTabHidden is dropped when
gBrowser.selectedBrowser == browser, so a window that becomes hidden while
its tab is still the selected one never auto-PiPs. Splitting that single gate
in two was enough to cover the app-switch case: the existing
enable-when-switching-tabs pref keeps handling the switched-away case, and a
second pref handles the still-selected-but-occluded case.
No new platform plumbing was needed. Occlusion already reaches document
visibility via CanonicalBrowsingContext::RecomputeAppWindowVisibility
(IsFullyOccluded() -> SetIsActiveInternal(false)), so the visibilitychange
was already firing — it was just being ignored by that gate.
I have been running this locally on macOS 26.6 and it covers switching
applications, switching desktop Spaces, and another window covering the browser.
Would that help? Happy to put it up as a patch, or to leave it with you and just
test your WIP on macOS if that is more useful — whichever fits what you have
already.
| Assignee | ||
Comment 10•1 month ago
|
||
PictureInPicture:VideoTabHidden already fires whenever a tab's document becomes
hidden, but the handler drops the event when the tab is still the selected tab.
That means a window which becomes hidden while its tab stays selected -- switching
to a fullscreen app, minimizing, or another window covering it -- never
auto-opens the player, even though the same visibilitychange that drives the
switching-tabs case has already fired.
Occlusion already reaches document visibility on macOS via
CanonicalBrowsingContext::RecomputeAppWindowVisibility (IsFullyOccluded() ->
SetIsActiveInternal(false)), so no new platform plumbing is needed. This splits
the single gate in two: the tab-switched-away case keeps using
enable-when-switching-tabs, and a new enable-when-occluded pref (off by default,
mirroring its sibling) handles the still-selected-but-occluded case. The
docshell-restore path that reactivates an auto-pip'd browser is widened to the
new pref as well.
Updated•22 days ago
|
Comment 11•21 days ago
|
||
Comment 12•21 days ago
|
||
| bugherder | ||
Updated•19 days ago
|
Updated•15 days ago
|
Description
•