How should wl_surface.offset interact with subsurfaces?
There is an open question about the behaviour of subsurfaces vs. offset from wl_surface.offset()
and wl_surface.attach(..., dx, dy)
.
The current Weston implementation will accumulate offset (applying it to the combination of set_position
and any previous offsets) on subsurface commits, but reset the offset on wl_subsurface.set_position()
calls. For example:
-
wl_subsurface.set_position(child, 1, 1); wl_surface@parent.commit()
- the child will be offset by (1,1) into its parent -
wl_surface@child.offset(20, 20); wl_surface@child.commit()
- the child will be offset by (21,21) into its parent -
wl_surface@child.offset(3, 3); wl_surface@child.commit()
- the child will be offset by (24,24) into its parent -
wl_subsurface.set_position(child, 40, 40); wl_surface@parent.commit()
- the child will be offset by (40,40) into its parent -
wl_surface@child.offset(5, 5); wl_surface@child.commit()
- the child will be offset by (45,45) into its parent
Both wlroots and Mutter completely ignore any client-supplied offset to subsurface commits, only allowing the parent-relative subsurface position to change with an explicit wl_subsurface.set_position
call.
Weston should probably follow the other two and ignore offsets, to be consistent.
Going forward, should we:
- document this more explicitly in
wl_subsurface
spec, or - add a new protocol error banning this, or
- bump
wl_subcompositor
and document that offset on subsurfaces is respected from that version onwards (and its interaction withset_position
), or - something else?