Bug 466016 - Window type rule does not work in wayland
Summary: Window type rule does not work in wayland
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: rules (show other bugs)
Version: 5.27.0
Platform: Gentoo Packages Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-18 17:52 UTC by Bill
Modified: 2024-01-20 04:29 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bill 2023-02-18 17:52:54 UTC
SUMMARY
setting OSD window type does not work in wayland.  


STEPS TO REPRODUCE
1.  Open a video in firefox
2.  set video to "picture in picture" mode
3:  Right click the window and select "configure special window settings"
4.  Apply the rule "set window type: force: on screen display"
5.  Press "apply" and "ok" in the window rules page

OBSERVED RESULT
Upon reopening the "configure special windows settings" page, the "set window type" rule is set back to "all window types" instead of "on screen display"  

EXPECTED RESULT

OSD window type should be set, and the picture in picture video should display on top of all other windows.  

SOFTWARE/OS VERSIONS
Linux gentoo
(available in About System)
KDE Plasma Version: 5.27 
KDE Frameworks Version: 5.103 
Qt Version: 5.15.8

ADDITIONAL INFORMATION
This was an attempt to apply the fix for https://bugs.kde.org/show_bug.cgi?id=439573 in wayland, however this workaround doesn't appear to work.  I noticed https://invent.kde.org/plasma/kwin/-/merge_requests/3612 was recently created, would it maybe be possible to have this be added to kwin rules or even replace the On Screen Display window rule in wayland?  As far as I can tell, the wayland pip protocol would allow windows to present above other fullscreen windows.
Comment 1 Vlad Zahorodnii 2023-02-20 09:15:05 UTC
Window type window rule is not implemented on wayland, not sure if it's worth implementing either. Various surface roles have their own separate implementations. It will be quite a hassle for us to make it work on wayland.

You can use "keep above" instead.
Comment 2 Bug Janitor Service 2024-01-16 23:49:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4953
Comment 3 Bug Janitor Service 2024-01-16 23:49:46 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4953
Comment 4 Vlad Zahorodnii 2024-01-17 23:15:23 UTC
Git commit 5c4acbdddda11df7beaef3575fcba064b2b5a67d by Vlad Zahorodnii.
Committed on 18/01/2024 at 00:05.
Pushed by vladz into branch 'master'.

Introduce layer window rule

The new window rule allows to overwrite the stack layer. It can be
useful on wayland to force picture-in-picture surfaces (which are
xdg-toplevels at the moment) to be placed above fullscreen windows.
Keep above flag is unsuitable because fullscreen windows are placed
higher "above" windows.

M  +2    -0    autotests/integration/dbus_interface_test.cpp
M  +41   -0    autotests/integration/xdgshellwindow_rules_test.cpp
M  +1    -0    src/dbusinterface.cpp
M  +24   -0    src/kcms/rules/rulesmodel.cpp
M  +1    -0    src/kcms/rules/rulesmodel.h
M  +9    -2    src/rules.cpp
M  +5    -0    src/rules.h
M  +21   -0    src/rulesettings.kcfg
M  +3    -2    src/window.cpp

https://invent.kde.org/plasma/kwin/-/commit/5c4acbdddda11df7beaef3575fcba064b2b5a67d
Comment 5 Vlad Zahorodnii 2024-01-17 23:15:31 UTC
Git commit 176ae6e6927f15f28c992b58366c4dd05fcc274a by Vlad Zahorodnii.
Committed on 18/01/2024 at 00:05.
Pushed by vladz into branch 'master'.

Drop window type rule

Practically all code assumes that the window type is static and fixing
it would bring extra complexity, which may not be worth given that there
are window rules to control position, focus, layer, etc.

M  +1    -1    src/inputpanelv1window.cpp
M  +1    -1    src/inputpanelv1window.h
M  +1    -1    src/internalwindow.cpp
M  +1    -1    src/internalwindow.h
M  +0    -7    src/kcms/rules/rulesmodel.cpp
M  +1    -1    src/layershellv1window.cpp
M  +1    -1    src/layershellv1window.h
M  +1    -11   src/rules.cpp
M  +0    -4    src/rules.h
M  +0    -11   src/rulesettings.kcfg
M  +1    -1    src/window.h
M  +1    -9    src/x11window.cpp
M  +1    -1    src/x11window.h
M  +1    -1    src/xdgshellwindow.cpp
M  +1    -1    src/xdgshellwindow.h

https://invent.kde.org/plasma/kwin/-/commit/176ae6e6927f15f28c992b58366c4dd05fcc274a
Comment 6 Bug Janitor Service 2024-01-17 23:17:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4972
Comment 7 Vlad Zahorodnii 2024-01-17 23:34:10 UTC
Git commit 7e6876cc630b4dbe720d2d9aa0953170731f5644 by Vlad Zahorodnii.
Committed on 18/01/2024 at 00:16.
Pushed by vladz into branch 'Plasma/6.0'.

Introduce layer window rule

The new window rule allows to overwrite the stack layer. It can be
useful on wayland to force picture-in-picture surfaces (which are
xdg-toplevels at the moment) to be placed above fullscreen windows.
Keep above flag is unsuitable because fullscreen windows are placed
higher "above" windows.
(cherry picked from commit 5c4acbdddda11df7beaef3575fcba064b2b5a67d)

M  +2    -0    autotests/integration/dbus_interface_test.cpp
M  +41   -0    autotests/integration/xdgshellwindow_rules_test.cpp
M  +1    -0    src/dbusinterface.cpp
M  +24   -0    src/kcms/rules/rulesmodel.cpp
M  +1    -0    src/kcms/rules/rulesmodel.h
M  +9    -2    src/rules.cpp
M  +5    -0    src/rules.h
M  +21   -0    src/rulesettings.kcfg
M  +3    -2    src/window.cpp

https://invent.kde.org/plasma/kwin/-/commit/7e6876cc630b4dbe720d2d9aa0953170731f5644
Comment 8 Vlad Zahorodnii 2024-01-17 23:34:18 UTC
Git commit 947d8c5e590e8d89fde2885abbb2bea8cce1b2e5 by Vlad Zahorodnii.
Committed on 18/01/2024 at 00:17.
Pushed by vladz into branch 'Plasma/6.0'.

Drop window type rule

Practically all code assumes that the window type is static and fixing
it would bring extra complexity, which may not be worth given that there
are window rules to control position, focus, layer, etc.
(cherry picked from commit 176ae6e6927f15f28c992b58366c4dd05fcc274a)

M  +1    -1    src/inputpanelv1window.cpp
M  +1    -1    src/inputpanelv1window.h
M  +1    -1    src/internalwindow.cpp
M  +1    -1    src/internalwindow.h
M  +0    -7    src/kcms/rules/rulesmodel.cpp
M  +1    -1    src/layershellv1window.cpp
M  +1    -1    src/layershellv1window.h
M  +1    -11   src/rules.cpp
M  +0    -4    src/rules.h
M  +0    -11   src/rulesettings.kcfg
M  +1    -1    src/window.h
M  +1    -9    src/x11window.cpp
M  +1    -1    src/x11window.h
M  +1    -1    src/xdgshellwindow.cpp
M  +1    -1    src/xdgshellwindow.h

https://invent.kde.org/plasma/kwin/-/commit/947d8c5e590e8d89fde2885abbb2bea8cce1b2e5