diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2019-10-25 16:28:50 +0200 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2019-11-28 17:32:44 +0100 |
commit | cd999f08c608458d6207110ed237c3a78441870b (patch) | |
tree | bdbfbb29327bd633f2ce683e6235560d1c9ff36f /hw/xwayland | |
parent | 1c6f875f52d74d2137161399e134c4888c4eadf2 (diff) |
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: https://gitlab.freedesktop.org/xorg/xserver/issues/835
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Diffstat (limited to 'hw/xwayland')
-rw-r--r-- | hw/xwayland/xwayland.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index 3ec754047..fc7932f67 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -24,6 +24,7 @@ */ #include "xwayland.h" +#include "xwayland-window-buffers.h" #include <stdio.h> @@ -902,6 +903,8 @@ ensure_surface_for_window(WindowPtr window) xorg_list_init(&xwl_window->link_damage); xorg_list_add(&xwl_window->link_window, &xwl_screen->window_list); + xwl_window_buffers_init(xwl_window); + xwl_window_init_allow_commits(xwl_window); return TRUE; @@ -1005,6 +1008,8 @@ xwl_unrealize_window(WindowPtr window) xorg_list_del(&xwl_window->link_window); unregister_damage(window); + xwl_window_buffers_dispose(xwl_window); + if (xwl_window->frame_callback) wl_callback_destroy(xwl_window->frame_callback); @@ -1053,6 +1058,7 @@ xwl_resize_window(WindowPtr window, screen->ResizeWindow = xwl_resize_window; if (xwl_window) { + xwl_window_buffers_recycle(xwl_window); xwl_window->x = x; xwl_window->y = y; xwl_window->width = width; @@ -1124,7 +1130,7 @@ xwl_window_post_damage(struct xwl_window *xwl_window) assert(!xwl_window->frame_callback); region = DamageRegion(window_get_damage(xwl_window->window)); - pixmap = (*xwl_screen->screen->GetWindowPixmap) (xwl_window->window); + pixmap = xwl_window_buffers_get_pixmap(xwl_window, region); #ifdef XWL_HAS_GLAMOR if (xwl_screen->glamor) |