[glide] Fix visual craziness when interrupting stage manager fade effect
- From: Robert Carr <racarr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glide] Fix visual craziness when interrupting stage manager fade effect
- Date: Fri, 7 May 2010 16:18:56 +0000 (UTC)
commit cadfec830fdc54122e7e149b5a731006a4507a3d
Author: Robert Carr <racarr Valentine localdomain>
Date: Fri May 7 12:01:20 2010 -0400
Fix visual craziness when interrupting stage manager fade effect
libglide/glide-stage-manager-priv.h | 2 ++
libglide/glide-stage-manager.c | 21 +++++++++++++++++++--
2 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/libglide/glide-stage-manager-priv.h b/libglide/glide-stage-manager-priv.h
index 3ba17e5..fd5e53e 100644
--- a/libglide/glide-stage-manager-priv.h
+++ b/libglide/glide-stage-manager-priv.h
@@ -43,6 +43,8 @@ struct _GlideStageManagerPrivate
GlideUndoManager *undo_manager;
gboolean animating;
+
+ ClutterTimeline *effect_timeline;
};
G_END_DECLS
diff --git a/libglide/glide-stage-manager.c b/libglide/glide-stage-manager.c
index b5ca4a4..d6bfa8a 100644
--- a/libglide/glide-stage-manager.c
+++ b/libglide/glide-stage-manager.c
@@ -61,10 +61,21 @@ glide_stage_manager_effect_fade_completed (ClutterTimeline *t, gpointer user_dat
clutter_actor_hide (a);
}
+static void
+glide_stage_manager_effect_completed (ClutterTimeline *t, gpointer user_data)
+{
+ GlideStageManager *manager = (GlideStageManager *)user_data;
+ manager->priv->effect_timeline = NULL;
+}
+
static void
-glide_stage_manager_effect_fade (ClutterActor *a, ClutterActor *b)
+glide_stage_manager_effect_fade (GlideStageManager *manager,
+ ClutterActor *a, ClutterActor *b)
{
ClutterTimeline *timeline = clutter_timeline_new (350);
+
+ if (manager->priv->effect_timeline)
+ clutter_timeline_advance (manager->priv->effect_timeline, clutter_timeline_get_duration (manager->priv->effect_timeline));
clutter_actor_show_all (b);
clutter_actor_raise (b, a);
@@ -75,8 +86,10 @@ glide_stage_manager_effect_fade (ClutterActor *a, ClutterActor *b)
clutter_actor_animate_with_timeline (b, CLUTTER_LINEAR, timeline, "opacity", 0xff, NULL);
clutter_timeline_start (timeline);
+ manager->priv->effect_timeline = timeline;
g_signal_connect (timeline, "completed", G_CALLBACK (glide_stage_manager_effect_fade_completed), a);
+ g_signal_connect (timeline, "completed", G_CALLBACK (glide_stage_manager_effect_completed), manager);
}
static void
@@ -205,6 +218,10 @@ glide_stage_manager_set_slide (GlideStageManager *manager,
guint slide)
{
GlideSlide *a, *b = glide_document_get_nth_slide (manager->priv->document, slide);
+
+ if (manager->priv->current_slide == slide)
+ return;
+
if (manager->priv->current_slide >= 0 && !(manager->priv->current_slide >= glide_document_get_n_slides (manager->priv->document)))
a = glide_document_get_nth_slide (manager->priv->document,
manager->priv->current_slide);
@@ -220,7 +237,7 @@ glide_stage_manager_set_slide (GlideStageManager *manager,
}
else
{
- glide_stage_manager_effect_fade (CLUTTER_ACTOR (a), CLUTTER_ACTOR (b));
+ glide_stage_manager_effect_fade (manager, CLUTTER_ACTOR (a), CLUTTER_ACTOR (b));
}
manager->priv->current_slide = slide;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]