Esempio n. 1
0
/**
 * 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));
}
Esempio n. 2
0
static void overview_animated_destroy(MosesOverview* self, MosesOverviewQuitReason reason, gboolean animate)
{
    MosesOverviewPrivate* priv = self->priv;

    gboolean just_destroy = !animate;
    if (reason == MOSES_OV_REASON_ACTIVATE_WINDOW && !priv->selected_actor) {
        just_destroy = TRUE;
    } else if (reason == MOSES_OV_REASON_ACTIVATE_WORKSPACE && !priv->selected_workspace) {
        just_destroy = TRUE;
    } else if (reason == MOSES_OV_REASON_NORMAL) {
        just_destroy = TRUE;
    }

    if (just_destroy) {
        clutter_actor_destroy(CLUTTER_ACTOR(self));
        return;
    }

    gfloat x, y, w, h;
    ClutterActor* target = NULL;

    if (reason == MOSES_OV_REASON_ACTIVATE_WINDOW) {
        target = self->priv->selected_actor;

        ClutterActor* orig = clutter_clone_get_source(CLUTTER_CLONE(target));
        clutter_actor_get_position(orig, &x, &y);
        clutter_actor_get_size(orig, &w, &h);
        g_signal_handlers_disconnect_by_func(target, on_effect_complete, self);

    } else if (reason == MOSES_OV_REASON_ACTIVATE_WORKSPACE) {
        g_assert(priv->selected_actor == NULL);

        MetaScreen* screen = meta_plugin_get_screen(priv->plugin);
        target = overview_head_get_actor_for_workspace(priv->ov_head, priv->selected_workspace);

        MetaRectangle geom;
        int focused_monitor = meta_screen_get_current_monitor(screen);
        meta_screen_get_monitor_geometry(screen, focused_monitor, &geom);
        x = geom.x, y = geom.y, w = geom.width, h = geom.height;
    }

    if (target) {
        clutter_actor_remove_all_transitions(target);
        clutter_actor_set_child_above_sibling(clutter_actor_get_parent(target), target, NULL);

        clutter_actor_save_easing_state(target);
        clutter_actor_set_easing_mode(target, CLUTTER_LINEAR);
        clutter_actor_set_easing_duration(target, 150);

        clutter_actor_set_position(target, x, y);
        clutter_actor_set_scale(target, w / clutter_actor_get_width(target),
                h / clutter_actor_get_height(target));
        clutter_actor_restore_easing_state(target);
        g_object_connect(target, "signal::transitions-completed",
                G_CALLBACK(on_restore_position_effect_complete), self, NULL);
    }
}
Esempio n. 3
0
static void
cancel_transitions (MetaBackgroundActor *self)
{
  MetaBackgroundActorPrivate *priv = self->priv;

  clutter_actor_remove_all_transitions (priv->top_actor);
  clutter_actor_set_opacity (priv->top_actor, 255);
  meta_background_set_layer (META_BACKGROUND (priv->bottom_actor), priv->background->texture);

  priv->transition_running = FALSE;
}
Esempio n. 4
0
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;
        }
}
Esempio n. 5
0
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;
        }
}
Esempio n. 6
0
/**
 * 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));
}