summaryrefslogtreecommitdiff
path: root/libmate-desktop/mate-bg-crossfade.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-02-03 23:09:51 +0100
committerraveit65 <[email protected]>2020-02-16 13:55:25 +0100
commite8fbac2ce193f5c2c93fdecb7ca0e14c1152ace6 (patch)
treef352830733cbf6ccf755a5cbe98d68ce9d4b3889 /libmate-desktop/mate-bg-crossfade.c
parent2edc2a7dfbf95cf710002d633ca11530ef094ce8 (diff)
downloadmate-desktop-e8fbac2ce193f5c2c93fdecb7ca0e14c1152ace6.tar.bz2
mate-desktop-e8fbac2ce193f5c2c93fdecb7ca0e14c1152ace6.tar.xz
Remove GTimeVal deprecation warning for GLib 2.61.2+
Diffstat (limited to 'libmate-desktop/mate-bg-crossfade.c')
-rw-r--r--libmate-desktop/mate-bg-crossfade.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libmate-desktop/mate-bg-crossfade.c b/libmate-desktop/mate-bg-crossfade.c
index fa083bb..ba1fbef 100644
--- a/libmate-desktop/mate-bg-crossfade.c
+++ b/libmate-desktop/mate-bg-crossfade.c
@@ -326,6 +326,18 @@ mate_bg_crossfade_set_start_surface (MateBGCrossfade* fade, cairo_surface_t *sur
return fade->priv->start_surface != NULL;
}
+#if GLIB_CHECK_VERSION(2,61,2)
+static gdouble
+get_current_time (void)
+{
+ const double microseconds_per_second = (double) G_USEC_PER_SEC;
+ gint64 tv;
+
+ tv = g_get_real_time ();
+
+ return (double) (tv / microseconds_per_second);
+}
+#else
static gdouble
get_current_time (void)
{
@@ -340,6 +352,7 @@ get_current_time (void)
return timestamp;
}
+#endif
/**
* mate_bg_crossfade_set_end_surface: