summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2010-11-01 11:15:30 -0400
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2010-11-02 12:04:37 +0900
commitbb0ff159cbdce46f1004a87491271dbe6980f26d (patch)
tree41c4d16fd9332cf31ac6fad2129613128a6590c2
parented62f93439b1f6d263b2eeab17b1bc08b69e414f (diff)
downloadgtk+-bb0ff159cbdce46f1004a87491271dbe6980f26d.tar.gz
GtkToolitemGroup: Use monotonic clock for animation timeout
-rw-r--r--gtk/gtktoolitemgroup.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c
index 9f238c6cb0..a1f4b052d2 100644
--- a/gtk/gtktoolitemgroup.c
+++ b/gtk/gtktoolitemgroup.c
@@ -1798,10 +1798,10 @@ gtk_tool_item_group_set_header_relief (GtkToolItemGroup *group,
static gint64
gtk_tool_item_group_get_animation_timestamp (GtkToolItemGroup *group)
{
- GTimeVal now;
+ GTimeSpec now;
- g_source_get_current_time (group->priv->animation_timeout, &now);
- return (now.tv_sec * G_USEC_PER_SEC + now.tv_usec - group->priv->animation_start) / 1000;
+ g_source_get_time (group->priv->animation_timeout, &now);
+ return (now.tv_sec * G_USEC_PER_SEC + now.tv_nsec / 1000 - group->priv->animation_start) / 1000;
}
static void
@@ -1924,14 +1924,14 @@ gtk_tool_item_group_set_collapsed (GtkToolItemGroup *group,
{
if (priv->animation)
{
- GTimeVal now;
+ GTimeSpec now;
- g_get_current_time (&now);
+ g_get_monotonic_time (&now);
if (priv->animation_timeout)
g_source_destroy (priv->animation_timeout);
- priv->animation_start = (now.tv_sec * G_USEC_PER_SEC + now.tv_usec);
+ priv->animation_start = (now.tv_sec * G_USEC_PER_SEC + now.tv_nsec / 1000);
priv->animation_timeout = g_timeout_source_new (ANIMATION_TIMEOUT);
g_source_set_callback (priv->animation_timeout,