From 1993f147d08170f07a72e43f0a0f27687e16967b Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Fri, 8 Jun 2018 16:23:44 +0200 Subject: [PATCH] xwayland: use pixmap size on present flip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the pixmap size does not match the present box size, flickering occurs. This can happen when the client changes its size (e.g. switching to fullscreen), and since the buffer is kept as long as the pixmap is valid, once the buffer is created, it remains at the wrong (old) size and causes continuous flickering. Use the actual pixmap's drawable size instead of the present box to create the buffer so that it's sized appropriately. Bugzilla: https://bugs.freedesktop.org/106841 Fixes: 0fb2cca193e6 "xwayland: Preliminary support for Present's new window flip mode" Signed-off-by: Olivier Fourdan Reviewed-by: Michel Dänzer Reviewed-by: Roman Gilg --- hw/xwayland/xwayland-present.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c index b5ae80dcf..c043da1d5 100644 --- a/hw/xwayland/xwayland-present.c +++ b/hw/xwayland/xwayland-present.c @@ -440,7 +440,7 @@ xwl_present_flip(WindowPtr present_window, { struct xwl_window *xwl_window = xwl_window_from_window(present_window); struct xwl_present_window *xwl_present_window = xwl_present_window_priv(present_window); - BoxPtr present_box, damage_box; + BoxPtr damage_box; Bool buffer_created; struct wl_buffer *buffer; struct xwl_present_event *event; @@ -448,7 +448,6 @@ xwl_present_flip(WindowPtr present_window, if (!xwl_window) return FALSE; - present_box = RegionExtents(&present_window->winSize); damage_box = RegionExtents(damage); event = malloc(sizeof *event); @@ -458,8 +457,8 @@ xwl_present_flip(WindowPtr present_window, xwl_window->present_window = present_window; buffer = xwl_glamor_pixmap_get_wl_buffer(pixmap, - present_box->x2 - present_box->x1, - present_box->y2 - present_box->y1, + pixmap->drawable.width, + pixmap->drawable.height, &buffer_created); event->event_id = event_id;