Bug 460873 - Missing Wayland API to access Kwin's "keep above others" and "show on all desktops"
Summary: Missing Wayland API to access Kwin's "keep above others" and "show on all des...
Status: CONFIRMED
Alias: None
Product: plasma-wayland-protocols
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-22 23:26 UTC by Oded Arbel
Modified: 2025-04-21 15:43 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
The full WAYLAND_DEBUG=1 log (53.04 KB, text/plain)
2025-04-21 15:42 UTC, Kovid Goyal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oded Arbel 2022-10-22 23:26:49 UTC
SUMMARY

The current org_kde_plasma_surface API is missing two APIs that are very useful for "quality of life" utilities such as yakuake, and were previously accessible on X11 (and similar APIs are available for applications runnong on the other popular windowing environments: Win32 and Cocoa):
1. "Keep above" - allow an application to request to be shown above other windows.
2. "Show on all desktops" - allow an application to appear on all virtual desktops at the same time.

Both of these behaviors are available through the window operations menu or by setting window rules, but both are not great workaround to the ability of the application to set these features:
1. Setting these through the window operations menu only applies to one window - if the application opens and closes (like yakuake does all the time, its kind of its point), then the window operations has to be manually repeated.
2. Using window rules is an advanced feature that most users won't know how to or be comfortable using.

I've also looked into the org_kde_plasma_window_management interface, which offers all of these features - but apparently that interface is not accessible to mere user applications.

The plasma/kwin specific org_kde_plasma_surface interface should offer these features, similar to how it currently offers the "skip taskbar" and "skip switcher" features.
Comment 1 openusr 2024-01-11 20:37:16 UTC
Encountering this on Fedora 39. Would greatly appreciate a fix.

Small description of the Window Rules workaround (might be useful for those searching):

- KDE Settings -> Window Management -> Window rules
- use button Detect Window Properties -> choose Yakuake window
	- name etc. is seen
	- search for "Keep above other windows"
	- click to add
- define the rule
	- Description: e.g. yakuake top
	- Window class (application): org.kde.yakuake
	- Match whole window class: No
	- Match window types: All selected
	- Arrangement and access
		- Keep above other windows: "Force" + Yes
-> Apply
Comment 2 Kovid Goyal 2025-04-21 15:42:05 UTC
Created attachment 180485 [details]
The full WAYLAND_DEBUG=1 log
Comment 3 Kovid Goyal 2025-04-21 15:42:26 UTC
SUMMARY
The wlr-layer-shell implementation in kwin has a bug where if the surface is unmapped by doing:

wl_surface_attach(surface, NULL, 0, 0); wl_surface_commit(surface);

and then later remapped by doing:
wl_surface_commit(surface);

no layer shell configure event is sent by kwin. Quoting the spec from 
https://wayland.app/protocols/wlr-layer-shell-unstable-v1

Attaching a null buffer to a layer surface unmaps it.

Unmapping a layer_surface means that the surface cannot be shown by the compositor until it is explicitly mapped again. The layer_surface returns to the state it had right after layer_shell.get_layer_surface. The client can re-map the surface by performing a commit without any buffer attached, waiting for a configure event and handling it as usual.

kwin is not sending the configure event at all. This works as expected
on sway and hyprland.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.13.0
Qt Version: 6.9.0

ADDITIONAL INFORMATION
Extract from the WAYLAND_DEBUG=1 log:

[2733789.462] {Default Queue}  -> wl_surface#29.attach(nil, 0, 0)
[2733789.474] {Default Queue}  -> wl_surface#29.commit()
[2733792.214] {Default Queue} wl_keyboard#28.leave(1140, wl_surface#29)
[2741813.411] {Default Queue}  -> wl_surface#29.commit()
[2755957.349] {Default Queue}  -> wp_fractional_scale_v1#30.destroy()

The first line shows the surface being unmapped with a nil buffer and
committed. Then one second later, the surface is committed again,
nothing is received from kwin for an additional 14 seconds at which
point the application quits starting the destroy sequence.
Comment 4 Kovid Goyal 2025-04-21 15:43:19 UTC
Apologies posted to wrong bug report, please ignore.