From 716805e3ad7b56c3d1cafb63002b7c26cd8b63bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Mon, 19 Feb 2024 18:43:47 +0100 Subject: [PATCH] xwayland: Call xwl_window_buffer_add_damage_region from damage_report Before clearing the damage region. Otherwise the damage region from a Present flip may be ignored when replacing the window pixmap. Part-of: --- hw/xwayland/xwayland-window-buffers.c | 2 +- hw/xwayland/xwayland-window-buffers.h | 1 + hw/xwayland/xwayland-window.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/xwayland/xwayland-window-buffers.c b/hw/xwayland/xwayland-window-buffers.c index 8751de918..5af0d6748 100644 --- a/hw/xwayland/xwayland-window-buffers.c +++ b/hw/xwayland/xwayland-window-buffers.c @@ -113,7 +113,7 @@ xwl_window_buffer_maybe_dispose(struct xwl_window_buffer *xwl_window_buffer) return TRUE; } -static void +void xwl_window_buffer_add_damage_region(struct xwl_window *xwl_window) { RegionPtr region = xwl_window_get_damage_region(xwl_window); diff --git a/hw/xwayland/xwayland-window-buffers.h b/hw/xwayland/xwayland-window-buffers.h index a2ff5fdb1..200c47767 100644 --- a/hw/xwayland/xwayland-window-buffers.h +++ b/hw/xwayland/xwayland-window-buffers.h @@ -31,6 +31,7 @@ #include "xwayland-types.h" +void xwl_window_buffer_add_damage_region(struct xwl_window *xwl_window); void xwl_window_buffers_init(struct xwl_window *xwl_window); void xwl_window_buffers_dispose(struct xwl_window *xwl_window); void xwl_window_recycle_pixmap(struct xwl_window *xwl_window); diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c index da614f57f..ea2a986ae 100644 --- a/hw/xwayland/xwayland-window.c +++ b/hw/xwayland/xwayland-window.c @@ -198,6 +198,7 @@ damage_report(DamagePtr pDamage, RegionPtr pRegion, void *data) /* This damage is from a Present flip, which already committed a new * buffer for the surface, so we don't need to do anything in response */ + xwl_window_buffer_add_damage_region(xwl_window); RegionEmpty(DamageRegion(pDamage)); xorg_list_del(&xwl_window->link_damage); xwl_window->present_flipped = FALSE;