[glide] Do not allow advancing another slide before animation finishes
- From: Robert Carr <racarr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glide] Do not allow advancing another slide before animation finishes
- Date: Thu, 29 Apr 2010 10:07:16 +0000 (UTC)
commit a7067211b090bf2f633cf1f3a869bfb0d3312cbf
Author: Robert Carr <racarr Valentine localdomain>
Date: Thu Apr 29 05:59:41 2010 -0400
Do not allow advancing another slide before animation finishes
src/glide-stage-manager-priv.h | 2 ++
src/glide-stage-manager.c | 16 +++++++++++++++-
2 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/src/glide-stage-manager-priv.h b/src/glide-stage-manager-priv.h
index 44a0091..3ba17e5 100644
--- a/src/glide-stage-manager-priv.h
+++ b/src/glide-stage-manager-priv.h
@@ -41,6 +41,8 @@ struct _GlideStageManagerPrivate
gulong key_notify_id;
GlideUndoManager *undo_manager;
+
+ gboolean animating;
};
G_END_DECLS
diff --git a/src/glide-stage-manager.c b/src/glide-stage-manager.c
index a0b4215..023e606 100644
--- a/src/glide-stage-manager.c
+++ b/src/glide-stage-manager.c
@@ -219,11 +219,23 @@ glide_stage_manager_set_document (GlideStageManager *manager,
g_signal_connect (document, "slide-removed", G_CALLBACK (glide_stage_manager_document_slide_removed_cb), manager);
}
+static void
+glide_stage_manager_timeline_completed (ClutterTimeline *timeline,
+ gpointer user_data)
+{
+ GlideStageManager *manager = (GlideStageManager *)user_data;
+
+ manager->priv->animating = FALSE;
+}
+
void
glide_stage_manager_advance_slide (GlideStageManager *manager)
{
+ if (manager->priv->animating)
+ return;
if (manager->priv->current_slide + 1 < glide_document_get_n_slides(manager->priv->document))
{
+ ClutterTimeline *t;
GlideSlide *a, *b;
const GlideAnimationInfo *a_info;
@@ -241,7 +253,9 @@ glide_stage_manager_advance_slide (GlideStageManager *manager)
manager->priv->current_slide++;
- glide_animation_manager_do_animation (a_info, CLUTTER_ACTOR (a), CLUTTER_ACTOR (b));
+ t = glide_animation_manager_do_animation (a_info, CLUTTER_ACTOR (a), CLUTTER_ACTOR (b));
+ manager->priv->animating = TRUE;
+ g_signal_connect (t, "completed", G_CALLBACK (glide_stage_manager_timeline_completed), manager);
// XXX: Maybe not?
g_object_notify (G_OBJECT (manager), "current-slide");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]