diff options
Diffstat (limited to 'src/core/effects.c')
-rw-r--r-- | src/core/effects.c | 43 |
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); } |