diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/effects.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/src/core/effects.c b/src/core/effects.c index 592e3470..658f6fa5 100644 --- a/src/core/effects.c +++ b/src/core/effects.c @@ -67,6 +67,7 @@ #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> @@ -98,6 +99,9 @@ typedef struct MetaRectangle start_rect; MetaRectangle end_rect; + MetaEffectFinished finished; + gpointer finished_data; + } BoxAnimationContext; /** @@ -149,7 +153,9 @@ static void draw_box_animation (MetaScreen *screen, MetaRectangle *initial_rect, MetaRectangle *destination_rect, - double seconds_duration); + double seconds_duration, + MetaEffectFinished finished, + gpointer finished_data); /** * Creates an effect. @@ -181,8 +187,8 @@ create_effect (MetaEffectType type, static void effect_free (MetaEffect *effect) { - if (effect->priv->finished) - effect->priv->finished (effect->priv->finished_data); + /*if (effect->priv->finished) + effect->priv->finished (effect->priv->finished_data);*/ g_free (effect->priv); g_free (effect); @@ -383,6 +389,8 @@ effects_draw_box_animation_timeout (BoxAnimationContext *context) graphics_sync (context); + context->finished(context->finished_data); + g_free (context); return FALSE; } @@ -430,7 +438,9 @@ void draw_box_animation (MetaScreen *screen, MetaRectangle *initial_rect, MetaRectangle *destination_rect, - double seconds_duration) + double seconds_duration, + MetaEffectFinished finished, + gpointer finished_data) { BoxAnimationContext *context; @@ -455,6 +465,9 @@ 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; @@ -717,13 +730,17 @@ 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); + 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_MINIMIZE_ANIMATION_LENGTH); + META_UNMINIMIZE_ANIMATION_LENGTH, + effect->priv->finished, + effect->priv->finished_data); break; default: |