aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-08-26 09:42:35 +0800
committerPo Lu2022-08-26 09:42:35 +0800
commit8cad97e3db879e21663aea5da6138618f4901154 (patch)
tree65822f1d5e1cba4d5376a507f3543f94ed07f8b7 /src
parent7ffac97f4908f0eaf38364336c1844665dd17335 (diff)
downloademacs-8cad97e3db879e21663aea5da6138618f4901154.tar.gz
emacs-8cad97e3db879e21663aea5da6138618f4901154.zip
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.
Diffstat (limited to 'src')
-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)
6905static void 6905static void
6906x_sync_trigger_fence (struct frame *f, XSyncValue value) 6906x_sync_trigger_fence (struct frame *f, XSyncValue value)
6907{ 6907{
6908 uint_fast64_t n, low, high, idx;
6909
6908 /* Sync fences aren't supported by the X server. */ 6910 /* Sync fences aren't supported by the X server. */
6909 if (FRAME_DISPLAY_INFO (f)->xsync_major < 3 6911 if (FRAME_DISPLAY_INFO (f)->xsync_major < 3
6910 || (FRAME_DISPLAY_INFO (f)->xsync_major == 3 6912 || (FRAME_DISPLAY_INFO (f)->xsync_major == 3
6911 && FRAME_DISPLAY_INFO (f)->xsync_minor < 1)) 6913 && FRAME_DISPLAY_INFO (f)->xsync_minor < 1))
6912 return; 6914 return;
6913 6915
6914 bool idx = !! (XSyncValueLow32 (value) & 4); 6916 low = XSyncValueLow32 (value);
6917 high = XSyncValueHigh32 (value);
6918
6919 n = low | (high << 32);
6920 idx = (n / 4) % 2;
6915 6921
6916#ifdef FRAME_DEBUG 6922#ifdef FRAME_DEBUG
6917 fprintf (stderr, "Triggering synchronization fence: %d\n", idx); 6923 fprintf (stderr, "Triggering synchronization fence: %lu\n", idx);
6918#endif 6924#endif
6919 6925
6920 XSyncTriggerFence (FRAME_X_DISPLAY (f), 6926 XSyncTriggerFence (FRAME_X_DISPLAY (f),