From b9b33d88ede76f0eec5055320e1cb27b37bade15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 15 Jun 2022 15:54:29 +0200 Subject: [PATCH] xwayland/present: Do not send two idle notify events for flip pixmaps Could happen if the buffer release event was already processed before xwl_present_flips_stop. Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1351 Reviewed-by: Olivier Fourdan --- hw/xwayland/xwayland-present.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c index ce74482ef..99e476b2f 100644 --- a/hw/xwayland/xwayland-present.c +++ b/hw/xwayland/xwayland-present.c @@ -276,7 +276,15 @@ xwl_present_flips_stop(WindowPtr window) xwl_present_free_idle_vblank(vblank); if (xwl_present_window->flip_active) { - xwl_present_free_idle_vblank(xwl_present_window->flip_active); + struct xwl_present_event *event; + + vblank = xwl_present_window->flip_active; + event = xwl_present_event_from_id((uintptr_t)vblank); + if (event->pixmap) + xwl_present_free_idle_vblank(vblank); + else + xwl_present_free_event(event); + xwl_present_window->flip_active = NULL; }