fix Wayland layer-shell protocol violation: "must ack the initial configure before attaching buffer #250
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This bug caused a Wayland layer-shell protocol violation: "must ack the initial configure before attaching buffer" which occurres when rapidly creating and destroying layer surfaces and I discovered this while working on pop-os/cosmic-settings#1554 and pop-os/cosmic-osd#151 .
Root Cause
The issue was a violation of the Wayland layer-shell protocol requirement that states configure events must be acknowledged before any buffers can be attached.
https://wayland.app/protocols/wlr-layer-shell-unstable-v1
The bug had two parts:
This meant layer surfaces could attempt to attach buffers before their first configure event was acknowledged, violating the protocol.
Solution
Part 1: Delay frame readiness until first configure
Part 2: Ensure configure processing happens before redraw