Start using the monotonic API in GLib ≥ 2.27
Starting from the 2.27 cycle, GLib is exposing a monotonic clock with microseconds granularity throughout the time-based API. We can start using it, given that the old, non-monotonic version is going to be deprecated by the same cycle.
This commit is contained in:
@ -144,11 +144,17 @@ clutter_frame_source_prepare (GSource *source,
|
||||
gint *delay)
|
||||
{
|
||||
ClutterFrameSource *frame_source = (ClutterFrameSource *) source;
|
||||
GTimeVal source_time;
|
||||
gint64 current_time;
|
||||
|
||||
g_source_get_current_time (source, &source_time);
|
||||
current_time = source_time.tv_sec * 1000 + source_time.tv_usec / 1000;
|
||||
#if GLIB_CHECK_VERSION (2, 27, 3)
|
||||
current_time = g_source_get_time (source) / 1000;
|
||||
#else
|
||||
{
|
||||
GTimeVal source_time;
|
||||
g_source_get_current_time (source, &source_time);
|
||||
current_time = source_time.tv_sec * 1000 + source_time.tv_usec / 1000;
|
||||
}
|
||||
#endif
|
||||
|
||||
return _clutter_timeout_interval_prepare (current_time,
|
||||
&frame_source->timeout,
|
||||
|
Reference in New Issue
Block a user