upvote
If you use KDE, you can work around this because of the powerful feature set the window manager has for setting custom window behavior.

1. Right click the PIP window and then click "More Actions-> Special Window Settings".

2. On the window that pops up, click "Add Property", and add "Window title". Change the drop-down from "Unimportant" to "Exact match" (this works on Firefox because the window title is always "Picture-in-Picture", you might have to do something slightly different on Chrome if it does something different).

3. Click "Add Property" again, add "Keep above other windows", change the drop-down to "Force", and change the radio button to "Yes".

4. From now on, all PIP windows will show up on top of other windows.

It would definitely be nicer if there was some sort of "always on top" permission that applications could request, but it's not too bad.

reply
Not too bad? A hidden procedure with ten clicks, which the user has to repeat for each web browser. And it may break at any time if the browser changes some details. Or if KDE changes. And it's specific to KDE, with no alternatives in most Wayland WMs.

All that for _one_ feature which works out-of-the-box with Xorg, and which Wayland removed for security reasons. From what I've seen, sharing the screen is another common feature which was broken with Wayland and is still painful.

I don't think Wayland's security model is very relevant to me since I have faith in Debian for filtering out rogue applications. So I have to reason to drop my smooth UX for a world of "not too bad" workarounds.

reply
Look, I'm not a Wayland booster, I still prefer X11 most of the time, but this is really the way it should work. Applications should not be allowed to dictate how windows appear. That is the job of the window manager. Chrome's PIP is a stupid workaround for Windows and Mac because they do not have robust window management.
reply
>> Chrome's PIP is a stupid workaround for Windows and Mac because they do not have robust window management.

What are you talking about? It's very convenient when I watch video while I do some work or entertaining thing on other web page or app. It's fine if you don't want to use it but many people do.

reply
For Chrome it's "Picture in picture"
reply
Wow, I guess Linux is only free if you don't value your time.
reply
I have a virtual pinball cab with two (and soon) three displays. Wayland really makes life difficult here because the software needs to always put the playfield on one display, the backglass on another, and the "dot matrix display" window on a third. That's a big no-no with Wayland. Fortunately KDE has window rules as a workaround. Sway and Hyprland allow similar rules. Mutter on Gnome has no equivalent.

I'm guessing this would mess up other games as well, like multi-screen flight simulators or driving games. It would be really nice if user-trusted apps could be granted permissions on an app-by-app basis to allow absolute placement of windows for these cases instead of making us jump through hoops.

reply
Yes, exactly. This security paranoia makes the devs' lives much more complicated. I have seen many apps turning off advanced features, such as screen color pickers. Automatation tools can be broken. Apps cant know their window positions, etc. You can see countless dev rants about Wayland and how it's generally unpleasant experience to work with.
reply
I know nothing about the detailed technical differences between X11 and Wayland but with Hyprland for me the PIP is working as expected so I assume its not just a Wayland issue but specific to the window manager you are using? Maybe somebody else can explain?
reply
As far as I know, there are multiple Wayland implementations. Which is also not good because it creates fragmentation and potential inconsistencies (some subtle differences in behavior, differences in bugs, etc). Maybe Hyprland solves the issue, but I don't want to use this DE just because it solves this particular issue. I have tons of other needs and preferences.
reply
Gnome has a "Always on Top" toggle for each window. I imagine there's a protocol for an application to set it by default but the OP's window manager might not implement it or there might be an incompatibility.
reply
But users do not want to have to toggle that for every PiP video they watch. Its why I am still on X11
reply
I can't speak for Gnome, but KDE makes it pretty easy to create rules that apply automatically to any new window that meets whatever arbitrary criteria you set.
reply
Plasma/KDE always had it.
reply
Isn't that usually how it goes? Wayland is a million little optional protocols, which in the abstract is a lovely idea but in practice means which things work depends on which grab-bag of features your compositor supports.
reply
I think in Hyprland it just works because floating windows stay on top by definition.
reply
deleted
reply
I fixed this like this:

1. Right click PIP window 2. More Actions -> Configure special window settings 3. Add property -> Layer Force Popup

After this it spawned always in middle, I also added property Position Remember, so it spawns where it was previously. I have no idea if this is the best way to fix but worked for me.

reply
I can't speak for Chrome, but I can right click a Firefox picture-in-picture window, tell it to remain on top, and it does, no problem. I've been using Plasma Wayland for years now and this has worked for ages
reply
The issue is you have to do that every single time. On X11, they remain on top by default
reply
Ah, for some reason I figured this was a minor bug that'd be fixed eventually. Wayland windows are never allowed to spawn always-on-top? Sort of lame.

If the logic is that it's the window manager's job to set window rules for this, fine, but in that case Plasma should probably ship with preconfigured rules matching the Chrome/Firefox PiP window.

I also find the lack of an Xlib-compatible macro API disruptive but I usually run an X11 session inside Xvnc for this purpose anyway.

reply
> Chrome "picture in picture" window doesn't stay on top when I click somewhere else since Wayland doesn't allow windows to stay on top.

Wayland doesn't allow apps to force themselves to be always on top. I would argue that it is up to the window manager to provide this functionality at the discretion of the user. Kwin does this.

reply
Strange... with Firefox in KDE/Plasma just works.
reply
I definitely have to right click on the window in the taskbar and select Always Keep On Top with Firefox on Plasma Wayland. Not too big a deal but would be nice if it was something Firefox could just set on its own.
reply