Bug 439573 - Firefox Picture-in-picture window not drawn on top of full screen window
Summary: Firefox Picture-in-picture window not drawn on top of full screen window
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.22.3
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2021-07-06 20:35 UTC by Tim
Modified: 2021-08-01 23:18 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
kwin rule (258 bytes, text/plain)
2021-07-06 22:48 UTC, David Edmundson
Details
xprop output for pip mode gnome (1.81 KB, text/plain)
2021-07-07 06:57 UTC, Tim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim 2021-07-06 20:35:49 UTC
STEPS TO REPRODUCE
1. Visit YouTube. Watch video.
2. Double right click.
3. Choose picture in picture.
4. Open different window and make full screen.

OBSERVED RESULT
Picture in picture is overlayed on top of all windows apart from full screen.

EXPECTED RESULT
Picture in picture should also overlay full screen. If not, option 'always on top' should be above full screen if selected.

ADDITIONAL INFORMATION
Using gnome at the moment which correctly handles pip mode. Even setting window as "always on top" in KDE results in full screen still doesn't place it on top of full screen windows.

Example uses:
Full screen game whilst watching a video picture in picture.
Full screen browser whilst watching a video picture in picture.
Comment 1 David Edmundson 2021-07-06 21:50:30 UTC
>Picture in picture should also overlay full screen. 

Spec says others:

https://specifications.freedesktop.org/wm-spec/wm-spec-1.3.html
section "Stacking order"

We don't want to break the spec. I am curious to what Mutter is doing internally, so I'll leave this open till we find out.

As a local solution you can set a window rule that moves FF into the OSD window type.
Comment 2 Tim 2021-07-06 22:19:37 UTC
(In reply to David Edmundson from comment #1)
> >Picture in picture should also overlay full screen. 
> 
> Spec says others:
> 
> https://specifications.freedesktop.org/wm-spec/wm-spec-1.3.html
> section "Stacking order"
> 
> We don't want to break the spec. I am curious to what Mutter is doing
> internally, so I'll leave this open till we find out.
> 
> As a local solution you can set a window rule that moves FF into the OSD
> window type.

Thanks David. The problem with that workaround is it moves the entire browser to the OSD layer, so its basically unusable for PIP mode where the browser has to be open in the background to play said video. It may work after minimizing the non-PIP window though. It may work using a different browser in full screen mode.

I understand what you're saying regarding the spec, but I think there should be an additional layer made for PIP windows. Its speculation, but I can only assume mutter has an additional layer, or uses the OSD layer for the PIP mode, and has a way to define the PIP popout window separate from other windows.

Perhaps this is something that could be implemented into Wayland?

The behavior of both Gnome and Windows allows for it, they seem to define a different window layer. I know windows has 'full screen exclusive' and 'fullscreen windowed' - with PiP windows on top of only the 'fullscreen windowed mode'.

I personally see this is such a basic quality of life feature, I was actually shocked to see I couldn't use it in KDE, nor define a specific window rule to make the window on top of full screen windows!
Comment 3 David Edmundson 2021-07-06 22:47:28 UTC
>ut I think there should be an additional layer made for PIP windows

We have non-standardised additional layers that we use in KDE (hence the OSD window type). I can't see any other hints on the window, but it's possible they only set them on gnome. Getting new standards into X11 world is a bit of a no-go.

If you can run xprop whilst in gnome and get output of the picture in picture window I would appreciate it.
Comment 4 David Edmundson 2021-07-06 22:48:12 UTC
Created attachment 139912 [details]
kwin rule

Found I needed to patch kwin: https://invent.kde.org/plasma/kwin/-/merge_requests/1155
Comment 5 Tim 2021-07-07 06:57:50 UTC
Created attachment 139914 [details]
xprop output for pip mode gnome
Comment 6 Tim 2021-07-07 06:59:24 UTC
Hi David, thanks for your help with this, really appreciate it.
I've attached the output.
Comment 7 David Edmundson 2021-07-07 10:32:46 UTC
Git commit e35ed5088ab358536046ba6e38ef707257d75013 by David Edmundson.
Committed on 07/07/2021 at 10:32.
Pushed by davidedmundson into branch 'master'.

[rules] Allow setting WindowType to KDE specific window type OSD

An example use case is allowing a user to write rules to put firefox
Picture in picture windows above fullscreen users

M  +1    -0    doc/windowspecific/index.docbook
M  +2    -1    src/kcmkwin/kwinrules/rulesmodel.cpp
M  +1    -1    src/rulesettings.kcfg

https://invent.kde.org/plasma/kwin/commit/e35ed5088ab358536046ba6e38ef707257d75013
Comment 8 David Edmundson 2021-08-01 23:18:36 UTC
As per spec, closing this. Relevant rule can be found as an attachment