Firefox Picture-in-Picture does not work properly under wayland

Hello,
I just switched to wayland and I think it’s pretty good. Except that I see that Firefox doesn’t fully support it, or at least it’s not well configured for it. In short, I can’t use the video overlay function, because the video windows automatically lose focus as soon as I click elsewhere and I have to define the new windows in order to keep them above the others.
Can you help me please?

Possibly a regression of this bug from a few years back:

This link is particularly informative:

1 Like

It has been an issue for a long time, as per this blog post from more than 3 years ago: This week in KDE: fixing longstanding bugs – Adventures in Linux and KDE

KWin window rules can now target special OSD windows like Firefox’s picture-in-picture overlay (David Edmundson, Plasma 5.23)

You do have a couple of choices (at least):

The first is to make a window rule for Firefox OSD windows via KDE System Settings

The second, and this is what I have done on my system, is to go into System Settings => Colors & Themes => Window Decorations => Configure Titlebar Buttons (at the top of the window). Then drag the “Keep above other windows” button to the Titlebar section. Apply the change & you will have a button on your titlebar that you can click on to keep the picture-in-picture window on top:

Screenshot_20241014_221510

Edit: It has been a while since I last used Picture-in-Picture, and I forgot that it now doesn’t have a titlebar. So my second option isn’t relevant anymore. However, you can still choose to keep a window without a titlebar on top by right-clicking its entry on the task manager & selecting to keep the window on top:

Screenshot_20241014_222733