/** * Simply restore pivot point and complete the effect within mutter */ static void map_done(ClutterActor *actor, MetaPlugin *plugin) { clutter_actor_remove_all_transitions(actor); g_signal_handlers_disconnect_by_func(actor, G_CALLBACK(map_done), plugin); g_object_set(actor, "pivot-point", &PV_NORM, NULL); meta_plugin_map_completed(plugin, META_WINDOW_ACTOR(actor)); }
static void on_map_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data) { /* * Must reverse the effect of the effect. */ MetaPlugin *plugin = data->plugin; MetaWindowActor *window_actor = META_WINDOW_ACTOR (data->actor); ActorPrivate *apriv = get_actor_private (window_actor); apriv->tml_map = NULL; /* Now notify the manager that we are done with this effect */ meta_plugin_map_completed (plugin, window_actor); g_free (data); }
void map(MetaPlugin *plugin, MetaWindowActor *window_actor) { ClutterActor *actor = CLUTTER_ACTOR(window_actor); clutter_actor_remove_all_transitions(actor); switch (MWT(window_actor)) { case META_WINDOW_POPUP_MENU: case META_WINDOW_DROPDOWN_MENU: case META_WINDOW_NOTIFICATION: case META_WINDOW_MENU: /* For menus we'll give em a nice fade in */ g_object_set(actor, "opacity", 0, NULL); clutter_actor_show(actor); clutter_actor_save_easing_state(actor); clutter_actor_set_easing_mode(actor, CLUTTER_EASE_IN_SINE); clutter_actor_set_easing_duration(actor, FADE_TIMEOUT); g_signal_connect(actor, "transitions-completed", G_CALLBACK(map_done), plugin); g_object_set(actor, "opacity", 255, NULL); clutter_actor_restore_easing_state(actor); break; case META_WINDOW_NORMAL: case META_WINDOW_DIALOG: case META_WINDOW_MODAL_DIALOG: g_object_set(actor, "opacity", 0, "scale-x", MAP_SCALE, "scale-y", MAP_SCALE, "pivot-point", &PV_CENTER, NULL); clutter_actor_show(actor); /* Initialise animation */ clutter_actor_save_easing_state(actor); clutter_actor_set_easing_mode(actor, CLUTTER_EASE_IN_SINE); clutter_actor_set_easing_duration(actor, MAP_TIMEOUT); g_signal_connect(actor, "transitions-completed", G_CALLBACK(map_done), plugin); /* Now animate. */ g_object_set(actor, "scale-x", 1.0, "scale-y", 1.0, "opacity", 255, NULL); clutter_actor_restore_easing_state(actor); break; default: meta_plugin_map_completed(plugin, window_actor); break; } }
/* * Simple map handler: it applies a scale effect which must be reversed on * completion). */ static void map (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); clutter_actor_set_pivot_point (actor, 0.5, 0.5); clutter_actor_set_opacity (actor, 0); clutter_actor_set_scale (actor, 0.5, 0.5); clutter_actor_show (actor); animation = clutter_actor_animate (actor, CLUTTER_EASE_OUT_QUAD, MAP_TIMEOUT, "opacity", 255, "scale-x", 1.0, "scale-y", 1.0, NULL); apriv->tml_map = clutter_animation_get_timeline (animation); data->actor = actor; data->plugin = plugin; g_signal_connect (apriv->tml_map, "completed", G_CALLBACK (on_map_effect_complete), data); } else meta_plugin_map_completed (plugin, window_actor); }
/* * Simple map handler: it applies a scale effect which must be reversed on * completion). */ static void map (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); clutter_actor_set_scale (actor, MAP_SCALE, MAP_SCALE); clutter_actor_set_opacity (actor, 0); clutter_actor_show (actor); animation = clutter_actor_animate (actor, CLUTTER_EASE_IN_SINE, MAP_TIMEOUT, "scale-x", 1.0, "scale-y", 1.0, "opacity", 255, NULL); apriv->tml_map = clutter_animation_get_timeline (animation); data->actor = actor; data->plugin = plugin; g_signal_connect (apriv->tml_map, "completed", G_CALLBACK (on_map_effect_complete), data); apriv->is_minimized = FALSE; } else if (type == META_WINDOW_DOCK) { /* For context menus (popup/dropdown) we fade the menu in */ ClutterAnimation *animation; EffectCompleteData *data = g_new0 (EffectCompleteData, 1); ActorPrivate *apriv = get_actor_private (window_actor); clutter_actor_set_opacity (actor, 0); clutter_actor_show (actor); animation = clutter_actor_animate (actor, CLUTTER_EASE_IN_SINE, MAP_TIMEOUT, "opacity", 255, NULL); apriv->tml_map = clutter_animation_get_timeline (animation); data->actor = actor; data->plugin = plugin; g_signal_connect (apriv->tml_map, "completed", G_CALLBACK (on_map_effect_complete), data); apriv->is_minimized = FALSE; } else meta_plugin_map_completed (plugin, window_actor); }
/** * shell_wm_completed_map: * @wm: the ShellWM * @actor: the MetaWindowActor actor * * The plugin must call this when it has completed a window map effect. **/ void shell_wm_completed_map (ShellWM *wm, MetaWindowActor *actor) { meta_plugin_map_completed (wm->plugin, actor); }
/** * sagarmatha_wm_completed_map: * @wm: the SagarmathaWM * @actor: the MetaWindowActor actor * * The plugin must call this when it has completed a window map effect. **/ void sagarmatha_wm_completed_map (SagarmathaWM *wm, MetaWindowActor *actor) { meta_plugin_map_completed (wm->plugin, actor); }
/** * cinnamon_wm_completed_map: * @wm: the CinnamonWM * @actor: the MetaWindowActor actor * * The plugin must call this when it has completed a window map effect. **/ void cinnamon_wm_completed_map (CinnamonWM *wm, MetaWindowActor *actor) { meta_plugin_map_completed (wm->plugin, actor); }