xwayland: Use multiple window buffers

Xwayland takes care of not attaching a new buffer if a frame callback is
pending.

Yet, the existing buffer (which was previously attached) may still be
updated from the X11 side, causing unexpected visual glitches to the
buffer.

Add multiple buffering to the xwl_window and alternate between buffers,
to leave the Wayland buffer untouched between frame callbacks and avoid
stuttering or tearing issues.

Closes: xorg/xserver#835
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
3 jobs for issue835 in 3 minutes and 55 seconds (queued for 21 seconds)
Status Job ID Name Coverage
  Docker Image
passed #1035331
debian-testing

00:00:34

 
  Build And Test
passed #1035332
autotools-build-and-test

00:03:20

passed #1035333
meson-build-and-test

00:01:52