Bug 503121 - wlr-layer-shell bug: No configure event is sent after the layer surfaceis unmapped and the remapped
Summary: wlr-layer-shell bug: No configure event is sent after the layer surfaceis unm...
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 6.3.4
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-21 15:44 UTC by Kovid Goyal
Modified: 2025-05-27 11:38 UTC (History)
2 users (show)

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


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

Note You need to log in before you can comment on or make changes to this bug.
Description Kovid Goyal 2025-04-21 15:44:09 UTC
Created attachment 180486 [details]
Full WAYLAND_DEBUG=1 log

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 1 Kovid Goyal 2025-04-22 08:16:17 UTC
Can be worked around by resetting the layer properties before committing the surface.
Comment 2 Vlad Zahorodnii 2025-05-27 11:07:42 UTC
Yeah, it's not implemented. Out of curiosity, may I ask what client unmaps its layer surface?
Comment 3 Kovid Goyal 2025-05-27 11:38:16 UTC
kitty in quick access terminal mode: https://sw.kovidgoyal.net/kitty/kittens/quick-access-terminal/