/* * Minimize effect completion callback; this function restores actor state, and * calls the manager callback function. */ static void on_minimize_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data) { /* * Must reverse the effect of the effect; must hide it first to ensure * that the restoration will not be visible. */ MetaPlugin *plugin = data->plugin; ActorPrivate *apriv; MetaWindowActor *window_actor = META_WINDOW_ACTOR (data->actor); apriv = get_actor_private (META_WINDOW_ACTOR (data->actor)); apriv->tml_minimize = NULL; clutter_actor_hide (data->actor); /* FIXME - we shouldn't assume the original scale, it should be saved * at the start of the effect */ clutter_actor_set_scale (data->actor, 1.0, 1.0); clutter_actor_move_anchor_point_from_gravity (data->actor, CLUTTER_GRAVITY_NORTH_WEST); /* Now notify the manager that we are done with this effect */ meta_plugin_minimize_completed (plugin, window_actor); g_free (data); }
/* * Simple minimize handler: it applies a scale effect (which must be reversed on * completion). */ static void minimize (MetaPlugin *plugin, MetaWindowActor *window_actor) { MetaWindowType type; MetaRectangle icon_geometry; MetaWindow *meta_window = meta_window_actor_get_meta_window (window_actor); ClutterActor *actor = CLUTTER_ACTOR (window_actor); type = meta_window_get_window_type (meta_window); if (!meta_window_get_icon_geometry(meta_window, &icon_geometry)) { icon_geometry.x = 0; icon_geometry.y = 0; } if (type == META_WINDOW_NORMAL) { ClutterAnimation *animation; EffectCompleteData *data = g_new0 (EffectCompleteData, 1); ActorPrivate *apriv = get_actor_private (window_actor); apriv->is_minimized = TRUE; clutter_actor_move_anchor_point_from_gravity (actor, CLUTTER_GRAVITY_CENTER); animation = clutter_actor_animate (actor, CLUTTER_EASE_IN_SINE, MINIMIZE_TIMEOUT, "scale-x", 0.0, "scale-y", 0.0, "x", (double)icon_geometry.x, "y", (double)icon_geometry.y, NULL); apriv->tml_minimize = clutter_animation_get_timeline (animation); data->plugin = plugin; data->actor = actor; g_signal_connect (apriv->tml_minimize, "completed", G_CALLBACK (on_minimize_effect_complete), data); } else meta_plugin_minimize_completed (plugin, window_actor); }
/** * sagarmatha_wm_completed_minimize: * @wm: the SagarmathaWM * @actor: the MetaWindowActor actor * * The plugin must call this when it has completed a window minimize effect. **/ void sagarmatha_wm_completed_minimize (SagarmathaWM *wm, MetaWindowActor *actor) { meta_plugin_minimize_completed (wm->plugin, actor); }
/** * shell_wm_completed_minimize: * @wm: the ShellWM * @actor: the MetaWindowActor actor * * The plugin must call this when it has completed a window minimize effect. **/ void shell_wm_completed_minimize (ShellWM *wm, MetaWindowActor *actor) { meta_plugin_minimize_completed (wm->plugin, actor); }
/** * cinnamon_wm_completed_minimize: * @wm: the CinnamonWM * @actor: the MetaWindowActor actor * * The plugin must call this when it has completed a window minimize effect. **/ void cinnamon_wm_completed_minimize (CinnamonWM *wm, MetaWindowActor *actor) { meta_plugin_minimize_completed (wm->plugin, actor); }