swaywm / swaylock

Screen locker for Wayland
MIT License
851 stars 202 forks source link

wl_buffer destroyed before surface committed #299

Closed wmww closed 1 year ago

wmww commented 1 year ago

In render_frame_background() a buffer is created, attached and destroyed before it's surface is committed. Swaylock seems to expect the compositor to render using this buffer (if it doesn't the surface is unmapped and nothing is displayed.

It's unclear to me if this behavior is supposed to be allowed by the protocol. It is possible for compositors to support it at a technical level, but neither Weston or Mir do currently (I ran into this trying to add lock screen support to Mir). I think it would be best to not destroy the buffer until after it has been committed.

This issue was introduced in 1d3e62c67f07a180fca02a6df1cf9648f2b50349, and has not yet been present in a release.

emersion commented 1 year ago

Right, my understanding of the spec is that clients are allowed to destroy buffers after wl_surface.attach, but I think many compositors don't support that...

wmww commented 1 year ago

This wasn't obvious to me from reading the spec, and Weston doesn't support it. Is there any particular wording in the spec or other source you can point to that says that's allowed?

emersion commented 1 year ago

Filled https://gitlab.freedesktop.org/wayland/wayland/-/issues/387