emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 8cad97e3db: Restore old code in x_sync_trigger_fence


From: Po Lu
Subject: master 8cad97e3db: Restore old code in x_sync_trigger_fence
Date: Thu, 25 Aug 2022 21:43:35 -0400 (EDT)

branch: master
commit 8cad97e3db879e21663aea5da6138618f4901154
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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.
---
 src/xterm.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 5a36aa0302..b91d3a9517 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),



reply via email to

[Prev in Thread] Current Thread [Next in Thread]