Skip to content

helium/ui: improve automatic Picture-in-Picture behavior#1765

Open
firatciftci wants to merge 11 commits into
imputnet:mainfrom
firatciftci:auto-pip-window-focus
Open

helium/ui: improve automatic Picture-in-Picture behavior#1765
firatciftci wants to merge 11 commits into
imputnet:mainfrom
firatciftci:auto-pip-window-focus

Conversation

@firatciftci
Copy link
Copy Markdown

@firatciftci firatciftci commented May 22, 2026

For your pull request to not get closed without review, please confirm that:

  • An issue exists where the maintainers agreed that this should be implemented (an approved feature request, or confirmed bug).
  • I tested that my contribution works locally, and does not break anything, otherwise I have marked my PR as draft.
  • If my contribution is non-trivial, I did not use AI to write most of it.
  • I understand that I will be permanently banned from interacting with this organization if I lied by checking any of these checkboxes.

Tested on (check one or more):

  • Windows
  • macOS
  • Linux

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 makes auto-PiP work in common multitasking cases such as:

  • switching to another Helium window
  • switching from Helium to another app
  • leaving the window that contains the visible video without changing tabs
  • moving to another Space on the same display

I've also added a new new Appearance setting toggle, so users can disable focus-loss auto-PiP without disabling Chromium’s existing tab-switch auto-PiP behavior.

Related issues:

@firatciftci firatciftci changed the title [FR]: Improve automatic Picture-in-Picture behavior helium/ui: improve automatic Picture-in-Picture behavior May 22, 2026
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 22, 2026

Reviews (1): Last reviewed commit: "helium/ui: rename patch file" | Re-trigger Greptile

Comment thread patches/helium/ui/improve-picture-in-picture-behavior.patch
Comment thread patches/helium/ui/improve-picture-in-picture-behavior.patch
@okseb
Copy link
Copy Markdown

okseb commented May 22, 2026

This is really interesting I installed the PiP extension and its already doing it automatically for me

Helium Version 0.12.3.1
macOS Version 15.7.7

@firatciftci
Copy link
Copy Markdown
Author

firatciftci commented May 22, 2026

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants