multiple wl surfaces commit in one client
Simon Ser
contact at emersion.fr
Thu Nov 5 07:35:04 UTC 2020
Hi,
On Thursday, November 5, 2020 3:26 AM, zou lan <nancy.lan.zou at gmail.com> wrote:
> Hi pekka
>
> I want to ask if in one client have created many wl surfaces, and commit all of them to weston in one frame, could weston guarantee to handle these surface update commands in one repaint?
>
> The sample code may like this:
> redraw() {
> wl_surface_commit(surface1);
> wl_surface_commit(surface2);
> wl_display_dispatch();
> }
>
> I think weston will handle the commit of surface1 and surface2 before next repaint because surface1 and surface2 are belong to one client, is that correct? Thank you!
No, there's no such guarantee. The OS could pre-empt the client after
the first wl_surface_commit is flushed on the wire and before the
second one is. The request reads on the compositor side could also be
split between these two requests. (This is still pretty unlikely, I
think in practice you'll get the two surfaces updated at the same
repaint "by chance" almost systematically.)
There's a WIP protocol to allow to synchronize multiple surfaces [1].
Simon
[1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/26
More information about the wayland-devel
mailing list