From a328bf65ef31d0134fc3d522f28b2da000a5e742 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Tue, 23 Aug 2022 20:52:41 +0800 Subject: [PATCH] Make frame synchronization conditional on clock_gettime * src/xfns.c (x_set_parent_frame) (x_set_use_frame_synchronization): * src/xterm.c (x_update_begin, show_back_buffer, x_update_end) (x_display_set_last_user_time, handle_one_xevent): * src/xterm.h (struct x_output): Define out vsync code when !HAVE_CLOCK_GETTIME. (bug#57346) --- src/xfns.c | 3 ++- src/xterm.c | 4 ++-- src/xterm.h | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/xfns.c b/src/xfns.c index 7eecda6dbd1..0b1f707e9fc 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -5156,7 +5156,8 @@ This function is an internal primitive--use `make-frame' instead. */) ((STRINGP (value) && !strcmp (SSDATA (value), "extended")) ? 2 : 1)); -#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK +#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK \ + && defined HAVE_CLOCK_GETTIME x_sync_init_fences (f); #endif #endif diff --git a/src/xterm.c b/src/xterm.c index 8de273cb8f5..26c512d80a8 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7600,7 +7600,7 @@ x_display_set_last_user_time (struct x_display_info *dpyinfo, Time time, #ifndef USE_GTK struct frame *focus_frame; Time old_time; -#if defined HAVE_XSYNC +#if defined HAVE_XSYNC && defined HAVE_CLOCK_GETTIME uint64_t monotonic_time; #endif @@ -27024,7 +27024,7 @@ x_free_frame_resources (struct frame *f) XFreeCursor (FRAME_X_DISPLAY (f), f->output_data.x->bottom_left_corner_cursor); /* Free sync fences. */ -#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK +#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK && defined CLOCK_GETTIME x_sync_free_fences (f); #endif } diff --git a/src/xterm.h b/src/xterm.h index 75277c166e0..8500ec27710 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1577,7 +1577,8 @@ extern void x_make_frame_invisible (struct frame *); extern void x_iconify_frame (struct frame *); extern void x_free_frame_resources (struct frame *); extern void x_wm_set_size_hint (struct frame *, long, bool); -#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK +#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK \ + && defined HAVE_CLOCK_GETTIME extern void x_sync_init_fences (struct frame *); #endif -- 2.39.5