From b0815b0b8c0502794b497ce36869b2ca8c284bb4 Mon Sep 17 00:00:00 2001 From: hujianwei Date: Tue, 8 Nov 2022 11:49:43 +0000 Subject: [PATCH] Fix initialization of server time overflow timer * time.c (StartAlarms): Fix comment. Initialize overflow timer A with negative delta. --- time.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/time.c b/time.c index 14c9546..2fb3c7c 100644 --- a/time.c +++ b/time.c @@ -182,7 +182,7 @@ StartAlarms (XSyncCounter counter, XSyncValue current_value) | XSyncCAValue | XSyncCAEvents); /* Start the first kind of alarm. This alarm assumes that the - counter does not wrap around along with the server time. + counter does wrap around along with the server time. The protocol allows for more kinds of server behavior, but all servers either implement the counter as one that wraps around @@ -199,10 +199,13 @@ StartAlarms (XSyncCounter counter, XSyncValue current_value) /* Set the trigger and ask for events. */ attributes.trigger = trigger; attributes.events = True; + XSyncIntToValue (&attributes.delta, -1); /* Create the alarm. */ alarm_a = XSyncCreateAlarm (compositor.display, - value_mask, &attributes); + value_mask | XSyncCADelta, + &attributes); + XSync (compositor.display, False); } else {