[9ae8f17cfc8ba7fd8fb34b2a194ef965a3b36a40839a46eeab1350e916692ac9/wip/high-res-server-time-really-isnt-system-time: 4/7] x11: Rename server_time_is_monotonic_time to server_time_uses_monotonic_time
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [9ae8f17cfc8ba7fd8fb34b2a194ef965a3b36a40839a46eeab1350e916692ac9/wip/high-res-server-time-really-isnt-system-time: 4/7] x11: Rename server_time_is_monotonic_time to server_time_uses_monotonic_time
- Date: Wed, 8 Jul 2020 13:28:35 +0000 (UTC)
commit cea744379828623c27fa6ff3c18ede786f37ba2c
Author: Ray Strode <rstrode redhat com>
Date: Tue Jul 7 16:15:42 2020 -0400
x11: Rename server_time_is_monotonic_time to server_time_uses_monotonic_time
The X server probably uses the monotonic clock when computing its
timestamps, but those timestamps are not just the monotonic clock
time without any sort of changes. X server timestamps are in
milliseconds and hard truncated to fit into 32-bits.
To make it clear that the server time is derived from, but not
exactly the monotonic time, this commit renames
server_time_is_monotonic_time to server_time_uses_monotonic_time.
gdk/x11/gdkdisplay-x11.c | 6 +++---
gdk/x11/gdkdisplay-x11.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 817944e3a58..a882ba5f195 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1311,7 +1311,7 @@ server_time_to_monotonic_time (GdkX11Display *display_x11,
gint64 server_time)
{
if (display_x11->server_time_query_time == 0 ||
- (!display_x11->server_time_is_monotonic_time &&
+ (!display_x11->server_time_uses_monotonic_time &&
server_time > display_x11->server_time_query_time + 10*1000*1000)) /* 10 seconds */
{
gint64 current_server_time = gdk_x11_get_server_time (display_x11->leader_gdk_window);
@@ -1327,12 +1327,12 @@ server_time_to_monotonic_time (GdkX11Display *display_x11,
*/
if (current_server_time_usec > current_monotonic_time - 1000*1000 &&
current_server_time_usec < current_monotonic_time + 1000*1000)
- display_x11->server_time_is_monotonic_time = TRUE;
+ display_x11->server_time_uses_monotonic_time = TRUE;
display_x11->server_time_offset = current_server_time_usec - current_monotonic_time;
}
- if (display_x11->server_time_is_monotonic_time)
+ if (display_x11->server_time_uses_monotonic_time)
return server_time;
else
return server_time - display_x11->server_time_offset;
diff --git a/gdk/x11/gdkdisplay-x11.h b/gdk/x11/gdkdisplay-x11.h
index 48100dc052d..e4a0e5cb14e 100644
--- a/gdk/x11/gdkdisplay-x11.h
+++ b/gdk/x11/gdkdisplay-x11.h
@@ -135,7 +135,7 @@ struct _GdkX11Display
gint64 server_time_query_time;
gint64 server_time_offset;
- guint server_time_is_monotonic_time : 1;
+ guint server_time_uses_monotonic_time : 1;
guint have_glx : 1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]