Request for clarication, sync mode wl_subsurfaces
The behavior of sync mode wl_subsurface
s is not clearly defined in some corner cases. This is briefly discussed in #324 as well, but I don't want to lump all subsurface related questions in one issue.
In synchronized mode, wl_surface.commit on a sub-surface will accumulate the committed state in a cache, but the state will not be applied and hence will not change the compositor output. The cached state is applied to the sub-surface immediately after the parent surface's state is applied.
It's not immediately clear when the parent surface's state will be applied, if the parent surface is also in sync mode. Consider this surface tree:
root -> P -> C
Both P
and C
are sync, root
is desync. Consider these sequence of operations:
# start: P has state_P1, C has state_C1
C.change_state() -> C has state_C1, and pending state state_C2
C.commit() -> C has state_C1, cached state state_C2
P.commit() -> what states does C have now?
C.change_state() -> C has ?, cached state ?, and pending state state_C3
C.commit() -> C has ?, cached state state_C3??
root.commit() -> what state does C have now? state_C2 or state_C3?
One way to interpret the spec is that, P.commit()
should accept the cached state of C
into its own cached state. Which means the blanks should be filled in like this:
# start: P has state_P1, C has state_C1
C.change_state() -> C has state_C1, and pending state state_C2
C.commit() -> C has state_C1, cached state state_C2
P.commit() -> C has state_C1, cached state state_C2
C.change_state() -> C has state_C1, cached state_C2, and pending state state_C3
C.commit() -> C has state_C1, cached state state_C3
root.commit() -> C has state_C2, cached state state_C3
But if we take the spec more literally, root.commit()
is where P
's state is applied, which means C
should take on its cached state at that moment, i.e. state_C3
instead of state_C2
.
Or perhaps P.commit()
should be considered where P
's state is applied? (Because its pending state is applied to its cached state)
Which one is correct?