/* * Simple TV-out like effect. */ static void destroy (MetaPlugin *plugin, MetaWindowActor *window_actor) { MetaWindowType type; ClutterActor *actor = CLUTTER_ACTOR (window_actor); MetaWindow *meta_window = meta_window_actor_get_meta_window (window_actor); type = meta_window_get_window_type (meta_window); if (type == META_WINDOW_NORMAL) { ClutterAnimation *animation; EffectCompleteData *data = g_new0 (EffectCompleteData, 1); ActorPrivate *apriv = get_actor_private (window_actor); animation = clutter_actor_animate (actor, CLUTTER_EASE_OUT_QUAD, DESTROY_TIMEOUT, "opacity", 0, "scale-x", 0.8, "scale-y", 0.8, NULL); apriv->tml_destroy = clutter_animation_get_timeline (animation); data->plugin = plugin; data->actor = actor; g_signal_connect (apriv->tml_destroy, "completed", G_CALLBACK (on_destroy_effect_complete), data); } else meta_plugin_destroy_completed (plugin, window_actor); }
/* * Destroy effect completion callback; this is a simple effect that requires no * further action than notifying the manager that the effect is completed. */ static void on_destroy_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data) { MetaPlugin *plugin = data->plugin; MetaWindowActor *window_actor = META_WINDOW_ACTOR (data->actor); ActorPrivate *apriv = get_actor_private (window_actor); apriv->tml_destroy = NULL; meta_plugin_destroy_completed (plugin, window_actor); }
void destroy(MetaPlugin *plugin, MetaWindowActor *window_actor) { ClutterActor *actor = CLUTTER_ACTOR(window_actor); clutter_actor_remove_all_transitions(actor); switch (MWT(window_actor)) { case META_WINDOW_NOTIFICATION: case META_WINDOW_NORMAL: case META_WINDOW_DIALOG: case META_WINDOW_MODAL_DIALOG: /* Initialise animation */ g_object_set(actor, "pivot-point", &PV_CENTER, NULL); clutter_actor_save_easing_state(actor); clutter_actor_set_easing_mode(actor, CLUTTER_EASE_OUT_QUAD); clutter_actor_set_easing_duration(actor, DESTROY_TIMEOUT); g_signal_connect(actor, "transitions-completed", G_CALLBACK(destroy_done), plugin); /* Now animate. */ g_object_set(actor, "scale-x", DESTROY_SCALE, "scale-y", DESTROY_SCALE, "opacity", 0, NULL); clutter_actor_restore_easing_state(actor); break; case META_WINDOW_MENU: /* Initialise animation */ clutter_actor_save_easing_state(actor); clutter_actor_set_easing_mode(actor, CLUTTER_EASE_OUT_QUAD); clutter_actor_set_easing_duration(actor, DESTROY_TIMEOUT); g_signal_connect(actor, "transitions-completed", G_CALLBACK(destroy_done), plugin); /* Now animate. */ g_object_set(actor, "opacity", 0, NULL); clutter_actor_restore_easing_state(actor); break; default: meta_plugin_destroy_completed(plugin, window_actor); break; } }
/* * Simple TV-out like effect. */ static void destroy (MetaPlugin *plugin, MetaWindowActor *window_actor) { MetaWindowType type; ClutterActor *actor = CLUTTER_ACTOR (window_actor); MetaWindow *meta_window = meta_window_actor_get_meta_window (window_actor); type = meta_window_get_window_type (meta_window); if (type == META_WINDOW_NORMAL || type == META_WINDOW_DIALOG || type == META_WINDOW_MODAL_DIALOG) { ClutterAnimation *animation; EffectCompleteData *data = g_new0 (EffectCompleteData, 1); ActorPrivate *apriv = get_actor_private (window_actor); clutter_actor_move_anchor_point_from_gravity (actor, CLUTTER_GRAVITY_CENTER); animation = clutter_actor_animate (actor, CLUTTER_EASE_IN_SINE, DESTROY_TIMEOUT, "scale-x", DESTROY_SCALE, "scale-y", DESTROY_SCALE, "opacity", 0, NULL); apriv->tml_destroy = clutter_animation_get_timeline (animation); data->plugin = plugin; data->actor = actor; g_signal_connect (apriv->tml_destroy, "completed", G_CALLBACK (on_destroy_effect_complete), data); } else meta_plugin_destroy_completed (plugin, window_actor); }
/** * notify mutter */ static void destroy_done(ClutterActor *actor, MetaPlugin *plugin) { clutter_actor_remove_all_transitions(actor); g_signal_handlers_disconnect_by_func(actor, G_CALLBACK(destroy_done), plugin); meta_plugin_destroy_completed(plugin, META_WINDOW_ACTOR(actor)); }
/** * shell_wm_completed_destroy: * @wm: the ShellWM * @actor: the MetaWindowActor actor * * The plugin must call this when it has completed a window destroy effect. **/ void shell_wm_completed_destroy (ShellWM *wm, MetaWindowActor *actor) { meta_plugin_destroy_completed (wm->plugin, actor); }
/** * sagarmatha_wm_completed_destroy: * @wm: the SagarmathaWM * @actor: the MetaWindowActor actor * * The plugin must call this when it has completed a window destroy effect. **/ void sagarmatha_wm_completed_destroy (SagarmathaWM *wm, MetaWindowActor *actor) { meta_plugin_destroy_completed (wm->plugin, actor); }
/** * cinnamon_wm_completed_destroy: * @wm: the CinnamonWM * @actor: the MetaWindowActor actor * * The plugin must call this when it has completed a window destroy effect. **/ void cinnamon_wm_completed_destroy (CinnamonWM *wm, MetaWindowActor *actor) { meta_plugin_destroy_completed (wm->plugin, actor); }