From: Po Lu Date: Fri, 26 Aug 2022 01:42:35 +0000 (+0800) Subject: Restore old code in x_sync_trigger_fence X-Git-Tag: emacs-29.0.90~1893^2~27 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8cad97e3db879e21663aea5da6138618f4901154;p=emacs.git Restore old code in x_sync_trigger_fence * src/xterm.c (x_sync_trigger_fence): Restore old code, since that makes it easier to adapt to more than 2 sync fences (which might be necessary in the future, if we ever decide to do frame handling asynchronously), and is much more recognizable for people coming from other programs. --- diff --git a/src/xterm.c b/src/xterm.c index 5a36aa03029..b91d3a95173 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6905,16 +6905,22 @@ x_sync_update_begin (struct frame *f) static void x_sync_trigger_fence (struct frame *f, XSyncValue value) { + uint_fast64_t n, low, high, idx; + /* Sync fences aren't supported by the X server. */ if (FRAME_DISPLAY_INFO (f)->xsync_major < 3 || (FRAME_DISPLAY_INFO (f)->xsync_major == 3 && FRAME_DISPLAY_INFO (f)->xsync_minor < 1)) return; - bool idx = !! (XSyncValueLow32 (value) & 4); + low = XSyncValueLow32 (value); + high = XSyncValueHigh32 (value); + + n = low | (high << 32); + idx = (n / 4) % 2; #ifdef FRAME_DEBUG - fprintf (stderr, "Triggering synchronization fence: %d\n", idx); + fprintf (stderr, "Triggering synchronization fence: %lu\n", idx); #endif XSyncTriggerFence (FRAME_X_DISPLAY (f),