From 13e513d2f04019424761b728340ec716de0c0d29 Mon Sep 17 00:00:00 2001 From: Jessica Clarke Date: Mon, 5 Dec 2022 19:58:21 +0000 Subject: [PATCH] xwayland: Stop using event address as event_id Nothing should be relying on this anymore, so use a counter like other places in the tree instead. This ensures that the event_id doesn't get cast back into a pointer again in future, and also may be slightly less confusing in cases where calloc reuses an address as debug logs would show the same event_id for those but now they will be distinct. Signed-off-by: Jessica Clarke --- hw/xwayland/xwayland-present.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c index 1c040b85f..66d8b4200 100644 --- a/hw/xwayland/xwayland-present.c +++ b/hw/xwayland/xwayland-present.c @@ -930,6 +930,7 @@ xwl_present_pixmap(WindowPtr window, present_notify_ptr notifies, int num_notifies) { + static uint64_t xwl_present_event_id; uint64_t ust = 0; uint64_t target_msc; uint64_t crtc_msc = 0; @@ -995,7 +996,7 @@ xwl_present_pixmap(WindowPtr window, return BadAlloc; } - vblank->event_id = (uintptr_t)event; + vblank->event_id = ++xwl_present_event_id; /* Xwayland presentations always complete (at least) one frame after they * are executed