summaryrefslogtreecommitdiff
path: root/src/core/effects.c
diff options
context:
space:
mode:
authorMonsta <[email protected]>2015-11-08 00:00:39 +0300
committerMonsta <[email protected]>2015-11-08 00:00:39 +0300
commit3ed3babc3ed31c7b03f7475205acc6c5e52bac81 (patch)
tree30956de0085aa456dab9a00c1026cbee9b1f6d38 /src/core/effects.c
parent228390697c5b89aee45796677cf1c98a8b50ba97 (diff)
downloadmarco-3ed3babc3ed31c7b03f7475205acc6c5e52bac81.tar.bz2
marco-3ed3babc3ed31c7b03f7475205acc6c5e52bac81.tar.xz
Revert "Merge pull request #115 from Samsagax/animation-fix-clean"
This reverts commit 567890a8a1884247de29e9f97cf9cd8110247c04, reversing changes made to a65a66d49bd0d6ec6c94b8e3ecd551cb570cec95.
Diffstat (limited to 'src/core/effects.c')
-rw-r--r--src/core/effects.c43
1 files changed, 8 insertions, 35 deletions
diff --git a/src/core/effects.c b/src/core/effects.c
index 163ec054..2866246f 100644
--- a/src/core/effects.c
+++ b/src/core/effects.c
@@ -67,7 +67,6 @@
#endif
#define META_MINIMIZE_ANIMATION_LENGTH 0.25
-#define META_UNMINIMIZE_ANIMATION_LENGTH 0.25
#define META_SHADE_ANIMATION_LENGTH 0.2
#include <string.h>
@@ -99,9 +98,6 @@ typedef struct
MetaRectangle start_rect;
MetaRectangle end_rect;
- MetaEffectFinished finished;
- gpointer finished_data;
-
} BoxAnimationContext;
/**
@@ -153,9 +149,7 @@ static void
draw_box_animation (MetaScreen *screen,
MetaRectangle *initial_rect,
MetaRectangle *destination_rect,
- double seconds_duration,
- MetaEffectFinished finished,
- gpointer finished_data);
+ double seconds_duration);
/**
* Creates an effect.
@@ -179,13 +173,17 @@ create_effect (MetaEffectType type,
}
/**
- * Destroys an effect.
+ * Destroys an effect. If the effect has a "finished" hook, it will be
+ * called before cleanup.
*
* \param effect The effect.
*/
static void
effect_free (MetaEffect *effect)
{
+ if (effect->priv->finished)
+ effect->priv->finished (effect->priv->finished_data);
+
g_free (effect->priv);
g_free (effect);
}
@@ -366,8 +364,6 @@ effects_draw_box_animation_timeout (BoxAnimationContext *context)
context->gc);
#endif /* !HAVE_SHAPE */
- context->finished(context->finished_data);
-
g_free (context);
return FALSE;
}
@@ -415,9 +411,7 @@ void
draw_box_animation (MetaScreen *screen,
MetaRectangle *initial_rect,
MetaRectangle *destination_rect,
- double seconds_duration,
- MetaEffectFinished finished,
- gpointer finished_data)
+ double seconds_duration)
{
BoxAnimationContext *context;
@@ -442,9 +436,6 @@ draw_box_animation (MetaScreen *screen,
context->start_rect = *initial_rect;
context->end_rect = *destination_rect;
- context->finished = finished;
- context->finished_data = finished_data;
-
#ifdef HAVE_SHAPE
attrs.override_redirect = True;
@@ -707,17 +698,7 @@ run_default_effect_handler (MetaEffect *effect)
draw_box_animation (effect->window->screen,
&(effect->u.minimize.window_rect),
&(effect->u.minimize.icon_rect),
- META_MINIMIZE_ANIMATION_LENGTH,
- effect->priv->finished,
- effect->priv->finished_data);
- break;
- case META_EFFECT_UNMINIMIZE:
- draw_box_animation (effect->window->screen,
- &(effect->u.minimize.icon_rect),
- &(effect->u.minimize.window_rect),
- META_UNMINIMIZE_ANIMATION_LENGTH,
- effect->priv->finished,
- effect->priv->finished_data);
+ META_MINIMIZE_ANIMATION_LENGTH);
break;
default:
@@ -728,16 +709,8 @@ run_default_effect_handler (MetaEffect *effect)
static void
run_handler (MetaEffect *effect)
{
- /* If effects are disabled just run the finished function */
if (meta_prefs_get_mate_animations ())
- {
run_default_effect_handler (effect);
- }
- else
- {
- if (effect->priv->finished)
- effect->priv->finished(effect->priv->finished_data);
- }
effect_free (effect);
}