[RFC weston v2] libweston: Commit subsurfaces before committing root surface

Pekka Paalanen ppaalanen at gmail.com
Thu Jan 30 14:53:04 UTC 2020


On Tue,  6 Mar 2018 17:57:15 +0100
Philipp Kerling <pkerling at casix.org> wrote:

> Committing the root surface triggers a commit of the xdg_surface state,
> which might require the subsurface state already being applied (e.g.
> when an xdg_toplevel needs to follow size constraints, the subsurfaces
> must be in the right position and size at the time this is verified).
> ---
>  libweston/compositor.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libweston/compositor.c b/libweston/compositor.c
> index aec937bb..8589e390 100644
> --- a/libweston/compositor.c
> +++ b/libweston/compositor.c
> @@ -3191,12 +3191,12 @@ surface_commit(struct wl_client *client, struct wl_resource *resource)
>  		return;
>  	}
>  
> -	weston_surface_commit(surface);
> -
>  	wl_list_for_each(sub, &surface->subsurface_list, parent_link) {
>  		if (sub->surface != surface)
>  			weston_subsurface_parent_commit(sub, 0);
>  	}
> +
> +	weston_surface_commit(surface);
>  }
>  
>  static void

Hi,

I found this while going through my old unanswered emails. Your
rationale is quite sound.

I worry that this might break things like wl_subsurface.set_position
using the old vs. new parent surface origin as the reference point.
wl_surface.commit specification has some related wording about that.

OTOH, wl_subsurface.set_position is part of the parent state, so maybe
it doesn't matter. This would take code inspection to see if there is
any dependency between parent and sub-surface states.

If you are still interested, you can send this as a Gitlab merge
request.

https://gitlab.freedesktop.org/wayland/weston/blob/master/CONTRIBUTING.md


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20200130/b0a70a6b/attachment.sig>


More information about the wayland-devel mailing list