summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <mdaenzer@redhat.com>2022-06-15 15:54:29 +0200
committerMichel Dänzer <michel@daenzer.net>2022-06-21 09:42:35 +0000
commitb9b33d88ede76f0eec5055320e1cb27b37bade15 (patch)
tree0b47213f52dcd4483f34e585af1dc6206919b200
parent8cd0397e5b4c1f0e0add1fea67f82b811214bf3e (diff)
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 <ofourdan@redhat.com>
-rw-r--r--hw/xwayland/xwayland-present.c10
1 files changed, 9 insertions, 1 deletions
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;
}