gdm r6096 - in trunk: . gui/simple-greeter
- From: halfline svn gnome org
- To: svn-commits-list gnome org
- Subject: gdm r6096 - in trunk: . gui/simple-greeter
- Date: Thu, 3 Apr 2008 21:55:50 +0100 (BST)
Author: halfline
Date: Thu Apr 3 21:55:49 2008
New Revision: 6096
URL: http://svn.gnome.org/viewvc/gdm?rev=6096&view=rev
Log:
2008-04-03 Ray Strode <rstrode redhat com>
* gui/simple-greeter/gdm-timer.c:
(do_tick): make sure the timer always ticks
at 0.0 initially
Modified:
trunk/ChangeLog
trunk/gui/simple-greeter/gdm-timer.c
Modified: trunk/gui/simple-greeter/gdm-timer.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-timer.c (original)
+++ trunk/gui/simple-greeter/gdm-timer.c Thu Apr 3 21:55:49 2008
@@ -202,33 +202,42 @@
return timestamp;
}
+static void
+do_tick (GdmTimer *timer,
+ double progress,
+ double current_time)
+{
+ static const double frequency = 1.0 / GDM_TIMER_TICKS_PER_SECOND;
+ double next_tick;
+ double time_before_tick;
+ double tick_duration;
+
+ time_before_tick = current_time;
+ g_signal_emit (G_OBJECT (timer), signals[TICK], 0, progress);
+
+ current_time = get_current_time ();
+ tick_duration = current_time - time_before_tick;
+
+ next_tick = MAX (frequency - tick_duration, 0.0);
+ timer->priv->tick_timeout_id = 0;
+ gdm_timer_queue_next_tick (timer, next_tick);
+}
+
static gboolean
on_tick_timeout (GdmTimer *timer)
{
double progress;
- double time_before_tick;
+ double current_time;
double elapsed_time;
- time_before_tick = get_current_time ();
- elapsed_time = time_before_tick - timer->priv->start_time;
+ current_time = get_current_time ();
+ elapsed_time = current_time - timer->priv->start_time;
progress = elapsed_time / timer->priv->duration;
if (progress > 0.999) {
gdm_timer_stop (timer);
} else {
- static const double frequency = 1.0 / GDM_TIMER_TICKS_PER_SECOND;
- double next_tick;
- double time_after_tick;
- double tick_duration;
-
- g_signal_emit (G_OBJECT (timer), signals[TICK], 0, progress);
-
- time_after_tick = get_current_time ();
- tick_duration = time_after_tick - time_before_tick;
-
- next_tick = MAX (frequency - tick_duration, 0.0);
- timer->priv->tick_timeout_id = 0;
- gdm_timer_queue_next_tick (timer, next_tick);
+ do_tick (timer, progress, current_time);
}
return FALSE;
@@ -282,7 +291,8 @@
g_assert (timer->priv->tick_timeout_id == 0);
gdm_timer_set_is_started (timer, TRUE);
- gdm_timer_queue_next_tick (timer, 1.0 / GDM_TIMER_TICKS_PER_SECOND);
+
+ do_tick (timer, 0.0, timer->priv->start_time);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]