summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-08-26 09:42:35 +0800
committerPo Lu <luangruo@yahoo.com>2022-08-26 09:42:35 +0800
commit8cad97e3db879e21663aea5da6138618f4901154 (patch)
tree65822f1d5e1cba4d5376a507f3543f94ed07f8b7
parent7ffac97f4908f0eaf38364336c1844665dd17335 (diff)
downloademacs-8cad97e3db879e21663aea5da6138618f4901154.tar.gz
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.
-rw-r--r--src/xterm.c10
1 files changed, 8 insertions, 2 deletions
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),