gdm r6122 - in trunk: . gui/simple-greeter
- From: halfline svn gnome org
- To: svn-commits-list gnome org
- Subject: gdm r6122 - in trunk: . gui/simple-greeter
- Date: Mon, 7 Apr 2008 16:19:56 +0100 (BST)
Author: halfline
Date: Mon Apr 7 16:19:55 2008
New Revision: 6122
URL: http://svn.gnome.org/viewvc/gdm?rev=6122&view=rev
Log:
2008-04-07 Ray Strode <rstrode redhat com>
Properly cancel grow animation when its reached its end early.
* gui/simple-greeter/gdm-chooser-widget.c
(get_number_of_on_screen_rows): Fix off by one.
* gui/simple-greeter/gdm-timer.c (do_tick),
(on_tick_timeout), (gdm_timer_start): ref timer around
animation tick in case timer gets stopped during tick.
Don't queue another tick if timer is stopped
Modified:
trunk/ChangeLog
trunk/gui/simple-greeter/gdm-chooser-widget.c
trunk/gui/simple-greeter/gdm-timer.c
Modified: trunk/gui/simple-greeter/gdm-chooser-widget.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-chooser-widget.c (original)
+++ trunk/gui/simple-greeter/gdm-chooser-widget.c Mon Apr 7 16:19:55 2008
@@ -582,7 +582,7 @@
start_index = gtk_tree_path_get_indices (start_path);
end_index = gtk_tree_path_get_indices (end_path);
- number_of_rows = *end_index - *start_index;
+ number_of_rows = *end_index - *start_index + 1;
gtk_tree_path_free (start_path);
gtk_tree_path_free (end_path);
Modified: trunk/gui/simple-greeter/gdm-timer.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-timer.c (original)
+++ trunk/gui/simple-greeter/gdm-timer.c Mon Apr 7 16:19:55 2008
@@ -203,7 +203,7 @@
return timestamp;
}
-static void
+static double
do_tick (GdmTimer *timer,
double progress,
double current_time)
@@ -221,7 +221,7 @@
next_tick = MAX (frequency - tick_duration, 0.0);
- gdm_timer_queue_next_tick (timer, next_tick);
+ return next_tick;
}
static gboolean
@@ -230,6 +230,7 @@
double progress;
double current_time;
double elapsed_time;
+ double next_tick;
current_time = get_current_time ();
elapsed_time = current_time - timer->priv->start_time;
@@ -237,11 +238,19 @@
timer->priv->tick_timeout_id = 0;
+ g_object_ref (timer);
if (progress > 0.999) {
- gdm_timer_stop (timer);
+ do_tick (timer, 1.0, current_time);
+ if (timer->priv->is_started) {
+ gdm_timer_stop (timer);
+ }
} else {
- do_tick (timer, progress, current_time);
+ next_tick = do_tick (timer, progress, current_time);
+ if (timer->priv->is_started) {
+ gdm_timer_queue_next_tick (timer, next_tick);
+ }
}
+ g_object_unref (timer);
return FALSE;
}
@@ -275,6 +284,8 @@
gdm_timer_start (GdmTimer *timer,
double number_of_seconds)
{
+ double next_tick;
+
g_return_if_fail (GDM_IS_TIMER (timer));
g_return_if_fail (number_of_seconds > G_MINDOUBLE);
g_return_if_fail (!timer->priv->is_started);
@@ -286,6 +297,7 @@
gdm_timer_set_is_started (timer, TRUE);
do_tick (timer, 0.0, timer->priv->start_time);
+ gdm_timer_queue_next_tick (timer, next_tick);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]