helium/ui: improve automatic Picture-in-Picture behavior#1765
helium/ui: improve automatic Picture-in-Picture behavior#1765firatciftci wants to merge 14 commits into
Conversation
…endence and fullscreen space support
…ing and activation checks
…to PiP functionality
|
Reviews (1): Last reviewed commit: "helium/ui: rename patch file" | Re-trigger Greptile |
|
This is really interesting I installed the PiP extension and its already doing it automatically for me Helium Version 0.12.3.1 |
|
@okseb it handles the case of automatically invoking PiP when switching tabs, but (at least on my end) it's not handling the case of switching to another application or switching between multiple macOS spaces. There's also the case of PiP not showing up in non-desktop spaces too, alongside the forced safety margin Chromium adds around PiP (i.e., not letting it be flush with the screen's edge) that this PR is tackling. |
…and fullscreen space eligibility
|
Will the PiP window stay even if I hide Helium (not minimize) like the way Safari does works? |
|
@marlonjames71 Yes. |
|
@firatciftci Very nice! |
For your pull request to not get closed without review, please confirm that:
Tested on (check one or more):
This PR improves automatic Picture-in-Picture behavior so a playing video can enter PiP when its browser window loses focus, not only when the user switches tabs. The auto-PiP observer now also tracks browser activation, so a selected tab is treated as inactive for auto-PiP purposes when its containing browser is no longer the active browser. I've also adjusted things so that we keep auto-PiP from triggering when focus moves to another external display; on macOS, the display check uses the actual frontmost application window instead of global window ordering, which avoids suppressing PiP incorrectly during same-display Space switches.
Finally, this removes Chromium’s default PiP edge buffer so the PiP window can sit flush against the screen edge when restored near an edge. On macOS, the PiP window is also marked as eligible for existing fullscreen Spaces, so it can appear over native fullscreen apps instead of only regular desktop Spaces.
This also changes video PiP window placement to remember the most recent video PiP bounds globally, instead of effectively restoring placement per source tab/video. The cached placement is only updated after the PiP window has actually been shown, so temporary widget setup bounds do not get saved accidentally. When a later video has a different aspect ratio, Helium keeps the last PiP height and preserves the nearest edge/corner where possible.
This makes auto-PiP work in common multitasking cases such as:
I've also added a new Appearance setting toggle, so users can disable focus-loss auto-PiP without disabling Chromium’s existing tab-switch auto-PiP behavior.
Related issues: