From 9069af78a71f6b2aadb11334e5bef9a670a5043d Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Wed, 3 Apr 2024 16:20:47 +0200 Subject: [PATCH] protocol: define content updates and their internal queue Multiple protocols use the term content update without a fill definition. It makes sense to define it in the core protocol so that not every other protocol has to define it. This is supposed to retain the current semantics and only changes the documentation while defining new terms. Signed-off-by: Sebastian Wick --- protocol/wayland.xml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/protocol/wayland.xml b/protocol/wayland.xml index b3873304..091fa15b 100644 --- a/protocol/wayland.xml +++ b/protocol/wayland.xml @@ -1656,16 +1656,18 @@ Surface state (input, opaque, and damage regions, attached buffers, etc.) is double-buffered. Protocol requests modify the pending state, - as opposed to the current state in use by the compositor. A commit - request atomically applies all pending state, replacing the current - state. After commit, the new pending state is as documented for each - related request. + as opposed to the active state in use by the compositor. - On commit, a pending wl_buffer is applied first, and all other state - second. This means that all coordinates in double-buffered state are - relative to the new wl_buffer coming into use, except for - wl_surface.attach itself. If there is no pending wl_buffer, the - coordinates are relative to the current surface contents. + A commit request atomically creates a content update from the pending + state, even if the pending state has not been touched. The content + update is placed in a queue until it becomes active. After commit, the + new pending state is as documented for each related request. + + When the content update is applied, the wl_buffer is applied before all + other state. This means that all coordinates in double-buffered state + are relative to the newly attached wl_buffers, except for + wl_surface.attach itself. If there is no newly attached wl_buffer, the + coordinates are relative to the previous content update. All requests that need a commit to become effective are documented to affect double-buffered state.