-
Notifications
You must be signed in to change notification settings - Fork 268
Commits to unmapped layer surfaces error after role object has been destroyed #1979
Description
Originally from wmww/gtk4-layer-shell#119. GTK4 Layer Shell (a library I maintain) does some weird but technically legal things with the layer shell protocol due to how it interacts with GTK. In this case it calls:
zwlr_layer_surface_v1.destroy()wl_surface.attach(NULL, 0, 0)wl_surface.commit()
Which I believe should be allowed, however Smithay errors the client with "width 0 requested without setting left and right anchors".
Side note: this only happens on the native Rust Wayland stack, the libwayland once silently drops the error (I think because the error is being sent on a dead Wayland object).
Repro
- Install ghostty (it uses GTK4 Layer Shell)
- Put
keybind = global:cmd+backquote=toggle_quick_terminalin~/.config/ghostty/config - Run
cargo run -p anvil --no-default-features --features winit -- --winit - Run ghostty inside anvil
- Press Super+` to bring up the quick terminal (uses layer shell)
- Press Super+` again
- Note the the client is killed and main window appears, instead of just the quick terminal closing
Root Cause
I had my Claude investigate and she thinks the the problem is pre_commit_hook getting run after the layer surface object is destroyed. Indeed wmww@6a18fc4 appears to fix the bug, but I'm unconvinced this is the correct solution. Just adding a check seems like a hack, and this approach doesn't seem to apply as cleanly to XDG surface types, which also appear to have the same problem (untested).