2008-09-18 15:09:11 +00:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2008 Intel Corp.
|
|
|
|
*
|
|
|
|
* Author: Tomas Frydrych <tf@linux.intel.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
* 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2008-10-16 11:50:01 +00:00
|
|
|
#include "mutter-plugin.h"
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
#include <libintl.h>
|
|
|
|
#define _(x) dgettext (GETTEXT_PACKAGE, x)
|
|
|
|
#define N_(x) x
|
|
|
|
|
|
|
|
#include <clutter/clutter.h>
|
|
|
|
#include <gmodule.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2008-10-02 11:16:15 +00:00
|
|
|
#define DESTROY_TIMEOUT 250
|
|
|
|
#define MINIMIZE_TIMEOUT 250
|
|
|
|
#define MAXIMIZE_TIMEOUT 250
|
|
|
|
#define MAP_TIMEOUT 250
|
|
|
|
#define SWITCH_TIMEOUT 500
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-10-07 13:58:34 +00:00
|
|
|
#define ACTOR_DATA_KEY "MCCP-Default-actor-data"
|
2008-12-17 09:33:56 +00:00
|
|
|
|
|
|
|
#define MUTTER_TYPE_DEFAULT_PLUGIN (mutter_default_plugin_get_type ())
|
|
|
|
#define MUTTER_DEFAULT_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MUTTER_TYPE_DEFAULT_PLUGIN, MutterDefaultPlugin))
|
|
|
|
#define MUTTER_DEFAULT_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MUTTER_TYPE_DEFAULT_PLUGIN, MutterDefaultPluginClass))
|
|
|
|
#define MUTTER_IS_DEFAULT_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MUTTER_DEFAULT_PLUGIN_TYPE))
|
|
|
|
#define MUTTER_IS_DEFAULT_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MUTTER_TYPE_DEFAULT_PLUGIN))
|
|
|
|
#define MUTTER_DEFAULT_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MUTTER_TYPE_DEFAULT_PLUGIN, MutterDefaultPluginClass))
|
|
|
|
|
|
|
|
#define MUTTER_DEFAULT_PLUGIN_GET_PRIVATE(obj) \
|
|
|
|
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), MUTTER_TYPE_DEFAULT_PLUGIN, MutterDefaultPluginPrivate))
|
|
|
|
|
|
|
|
typedef struct _MutterDefaultPlugin MutterDefaultPlugin;
|
|
|
|
typedef struct _MutterDefaultPluginClass MutterDefaultPluginClass;
|
|
|
|
typedef struct _MutterDefaultPluginPrivate MutterDefaultPluginPrivate;
|
|
|
|
|
|
|
|
struct _MutterDefaultPlugin
|
|
|
|
{
|
|
|
|
MutterPlugin parent;
|
|
|
|
|
|
|
|
MutterDefaultPluginPrivate *priv;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _MutterDefaultPluginClass
|
|
|
|
{
|
|
|
|
MutterPluginClass parent_class;
|
|
|
|
};
|
|
|
|
|
2008-10-10 16:11:13 +00:00
|
|
|
static GQuark actor_data_quark = 0;
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-12-17 09:33:56 +00:00
|
|
|
static void minimize (MutterPlugin *plugin,
|
|
|
|
MutterWindow *actor);
|
|
|
|
static void map (MutterPlugin *plugin,
|
|
|
|
MutterWindow *actor);
|
|
|
|
static void destroy (MutterPlugin *plugin,
|
|
|
|
MutterWindow *actor);
|
|
|
|
static void maximize (MutterPlugin *plugin,
|
|
|
|
MutterWindow *actor,
|
2008-10-16 22:29:24 +00:00
|
|
|
gint x, gint y, gint width, gint height);
|
2008-12-17 09:33:56 +00:00
|
|
|
static void unmaximize (MutterPlugin *plugin,
|
|
|
|
MutterWindow *actor,
|
2008-10-16 22:29:24 +00:00
|
|
|
gint x, gint y, gint width, gint height);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-12-17 09:33:56 +00:00
|
|
|
static void switch_workspace (MutterPlugin *plugin,
|
|
|
|
const GList **actors, gint from, gint to,
|
2008-10-09 16:57:12 +00:00
|
|
|
MetaMotionDirection direction);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-12-17 09:33:56 +00:00
|
|
|
static void kill_effect (MutterPlugin *plugin,
|
|
|
|
MutterWindow *actor, gulong event);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-12-17 09:33:56 +00:00
|
|
|
static const MutterPluginInfo * plugin_info (MutterPlugin *plugin);
|
2008-10-13 11:23:47 +00:00
|
|
|
|
2008-12-17 09:33:56 +00:00
|
|
|
MUTTER_PLUGIN_DECLARE(MutterDefaultPlugin, mutter_default_plugin);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Plugin private data that we store in the .plugin_private member.
|
|
|
|
*/
|
2008-12-17 09:33:56 +00:00
|
|
|
struct _MutterDefaultPluginPrivate
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
|
|
|
/* Valid only when switch_workspace effect is in progress */
|
|
|
|
ClutterTimeline *tml_switch_workspace1;
|
|
|
|
ClutterTimeline *tml_switch_workspace2;
|
|
|
|
GList **actors;
|
|
|
|
ClutterActor *desktop1;
|
|
|
|
ClutterActor *desktop2;
|
|
|
|
|
2008-12-17 09:33:56 +00:00
|
|
|
MutterPluginInfo info;
|
|
|
|
|
2008-09-18 15:09:11 +00:00
|
|
|
gboolean debug_mode : 1;
|
2008-12-17 09:33:56 +00:00
|
|
|
};
|
|
|
|
|
2009-01-28 15:43:36 +00:00
|
|
|
/*
|
|
|
|
* Per actor private data we attach to each actor.
|
|
|
|
*/
|
|
|
|
typedef struct _ActorPrivate
|
2008-12-17 09:33:56 +00:00
|
|
|
{
|
2009-01-28 15:43:36 +00:00
|
|
|
ClutterActor *orig_parent;
|
2008-12-17 09:33:56 +00:00
|
|
|
|
2009-01-28 15:43:36 +00:00
|
|
|
ClutterTimeline *tml_minimize;
|
|
|
|
ClutterTimeline *tml_maximize;
|
|
|
|
ClutterTimeline *tml_destroy;
|
|
|
|
ClutterTimeline *tml_map;
|
2008-12-17 09:33:56 +00:00
|
|
|
|
2009-01-28 15:43:36 +00:00
|
|
|
gboolean is_minimized : 1;
|
|
|
|
gboolean is_maximized : 1;
|
|
|
|
} ActorPrivate;
|
|
|
|
|
|
|
|
/* callback data for when animations complete */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
ClutterActor *actor;
|
|
|
|
MutterPlugin *plugin;
|
|
|
|
} EffectCompleteData;
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
mutter_default_plugin_dispose (GObject *object)
|
|
|
|
{
|
|
|
|
/* MutterDefaultPluginPrivate *priv = MUTTER_DEFAULT_PLUGIN (object)->priv;
|
|
|
|
*/
|
2008-12-17 09:33:56 +00:00
|
|
|
G_OBJECT_CLASS (mutter_default_plugin_parent_class)->dispose (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
mutter_default_plugin_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
G_OBJECT_CLASS (mutter_default_plugin_parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
mutter_default_plugin_set_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
mutter_default_plugin_get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-04-12 21:34:49 +00:00
|
|
|
start (MutterPlugin *plugin)
|
2008-12-17 09:33:56 +00:00
|
|
|
{
|
2010-04-12 21:34:49 +00:00
|
|
|
MutterDefaultPluginPrivate *priv = MUTTER_DEFAULT_PLUGIN (plugin)->priv;
|
2008-12-17 09:33:56 +00:00
|
|
|
|
|
|
|
guint destroy_timeout = DESTROY_TIMEOUT;
|
|
|
|
guint minimize_timeout = MINIMIZE_TIMEOUT;
|
|
|
|
guint maximize_timeout = MAXIMIZE_TIMEOUT;
|
|
|
|
guint map_timeout = MAP_TIMEOUT;
|
|
|
|
guint switch_timeout = SWITCH_TIMEOUT;
|
|
|
|
|
|
|
|
if (mutter_plugin_debug_mode (plugin))
|
|
|
|
{
|
|
|
|
g_debug ("Plugin %s: Entering debug mode.", priv->info.name);
|
|
|
|
|
|
|
|
priv->debug_mode = TRUE;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Double the effect duration to make them easier to observe.
|
|
|
|
*/
|
|
|
|
destroy_timeout *= 2;
|
|
|
|
minimize_timeout *= 2;
|
|
|
|
maximize_timeout *= 2;
|
|
|
|
map_timeout *= 2;
|
|
|
|
switch_timeout *= 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
mutter_default_plugin_class_init (MutterDefaultPluginClass *klass)
|
|
|
|
{
|
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
|
|
|
MutterPluginClass *plugin_class = MUTTER_PLUGIN_CLASS (klass);
|
|
|
|
|
|
|
|
gobject_class->finalize = mutter_default_plugin_finalize;
|
|
|
|
gobject_class->dispose = mutter_default_plugin_dispose;
|
|
|
|
gobject_class->set_property = mutter_default_plugin_set_property;
|
|
|
|
gobject_class->get_property = mutter_default_plugin_get_property;
|
|
|
|
|
2010-04-12 21:34:49 +00:00
|
|
|
plugin_class->start = start;
|
2008-12-17 09:33:56 +00:00
|
|
|
plugin_class->map = map;
|
|
|
|
plugin_class->minimize = minimize;
|
|
|
|
plugin_class->maximize = maximize;
|
|
|
|
plugin_class->unmaximize = unmaximize;
|
|
|
|
plugin_class->destroy = destroy;
|
|
|
|
plugin_class->switch_workspace = switch_workspace;
|
|
|
|
plugin_class->kill_effect = kill_effect;
|
|
|
|
plugin_class->plugin_info = plugin_info;
|
|
|
|
|
|
|
|
g_type_class_add_private (gobject_class, sizeof (MutterDefaultPluginPrivate));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
mutter_default_plugin_init (MutterDefaultPlugin *self)
|
|
|
|
{
|
|
|
|
MutterDefaultPluginPrivate *priv;
|
|
|
|
|
|
|
|
self->priv = priv = MUTTER_DEFAULT_PLUGIN_GET_PRIVATE (self);
|
|
|
|
|
|
|
|
priv->info.name = "Default Effects";
|
|
|
|
priv->info.version = "0.1";
|
|
|
|
priv->info.author = "Intel Corp.";
|
|
|
|
priv->info.license = "GPL";
|
|
|
|
priv->info.description = "This is an example of a plugin implementation.";
|
|
|
|
}
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Actor private data accessor
|
|
|
|
*/
|
2008-10-10 16:11:13 +00:00
|
|
|
static void
|
|
|
|
free_actor_private (gpointer data)
|
|
|
|
{
|
|
|
|
if (G_LIKELY (data != NULL))
|
|
|
|
g_slice_free (ActorPrivate, data);
|
|
|
|
}
|
|
|
|
|
2008-09-18 15:09:11 +00:00
|
|
|
static ActorPrivate *
|
2008-10-16 11:50:01 +00:00
|
|
|
get_actor_private (MutterWindow *actor)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
2008-10-10 16:11:13 +00:00
|
|
|
ActorPrivate *priv = g_object_get_qdata (G_OBJECT (actor), actor_data_quark);
|
|
|
|
|
|
|
|
if (G_UNLIKELY (actor_data_quark == 0))
|
|
|
|
actor_data_quark = g_quark_from_static_string (ACTOR_DATA_KEY);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-10-10 16:11:13 +00:00
|
|
|
if (G_UNLIKELY (!priv))
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
2008-10-10 16:11:13 +00:00
|
|
|
priv = g_slice_new0 (ActorPrivate);
|
|
|
|
|
|
|
|
g_object_set_qdata_full (G_OBJECT (actor),
|
|
|
|
actor_data_quark, priv,
|
|
|
|
free_actor_private);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return priv;
|
|
|
|
}
|
|
|
|
|
2008-12-17 09:33:56 +00:00
|
|
|
typedef struct SwitchWorkspaceData
|
|
|
|
{
|
|
|
|
MutterPlugin *plugin;
|
|
|
|
const GList **actors;
|
|
|
|
} SwitchWorkspaceData;
|
|
|
|
|
2008-09-18 15:09:11 +00:00
|
|
|
static void
|
2009-01-28 15:43:36 +00:00
|
|
|
on_switch_workspace_effect_complete (ClutterTimeline *timeline, gpointer data)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
2008-12-17 09:33:56 +00:00
|
|
|
SwitchWorkspaceData *sw_data = data;
|
|
|
|
MutterPlugin *plugin = sw_data->plugin;
|
|
|
|
MutterDefaultPluginPrivate *priv = MUTTER_DEFAULT_PLUGIN (plugin)->priv;
|
|
|
|
GList *l = *((GList**)sw_data->actors);
|
2008-10-17 06:23:34 +00:00
|
|
|
MutterWindow *actor_for_cb = l->data;
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
while (l)
|
|
|
|
{
|
2008-10-16 22:29:24 +00:00
|
|
|
ClutterActor *a = l->data;
|
2008-10-16 11:50:01 +00:00
|
|
|
MutterWindow *mc_window = MUTTER_WINDOW (a);
|
2008-12-17 09:33:56 +00:00
|
|
|
ActorPrivate *apriv = get_actor_private (mc_window);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-12-17 09:33:56 +00:00
|
|
|
if (apriv->orig_parent)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
2008-12-17 09:33:56 +00:00
|
|
|
clutter_actor_reparent (a, apriv->orig_parent);
|
|
|
|
apriv->orig_parent = NULL;
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
l = l->next;
|
|
|
|
}
|
|
|
|
|
2008-12-17 09:33:56 +00:00
|
|
|
clutter_actor_destroy (priv->desktop1);
|
|
|
|
clutter_actor_destroy (priv->desktop2);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-12-17 09:33:56 +00:00
|
|
|
priv->actors = NULL;
|
|
|
|
priv->tml_switch_workspace1 = NULL;
|
|
|
|
priv->tml_switch_workspace2 = NULL;
|
|
|
|
priv->desktop1 = NULL;
|
|
|
|
priv->desktop2 = NULL;
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-12-17 09:33:56 +00:00
|
|
|
g_free (data);
|
|
|
|
|
|
|
|
mutter_plugin_effect_completed (plugin, actor_for_cb,
|
2008-10-16 22:02:34 +00:00
|
|
|
MUTTER_PLUGIN_SWITCH_WORKSPACE);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-12-17 09:33:56 +00:00
|
|
|
switch_workspace (MutterPlugin *plugin,
|
|
|
|
const GList **actors, gint from, gint to,
|
2008-10-09 16:57:12 +00:00
|
|
|
MetaMotionDirection direction)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
2008-12-17 09:33:56 +00:00
|
|
|
MutterDefaultPluginPrivate *priv = MUTTER_DEFAULT_PLUGIN (plugin)->priv;
|
2008-10-17 06:23:34 +00:00
|
|
|
GList *l;
|
|
|
|
gint n_workspaces;
|
|
|
|
ClutterActor *workspace0 = clutter_group_new ();
|
|
|
|
ClutterActor *workspace1 = clutter_group_new ();
|
|
|
|
ClutterActor *stage;
|
|
|
|
int screen_width, screen_height;
|
2008-12-17 09:33:56 +00:00
|
|
|
MetaScreen *screen = mutter_plugin_get_screen (plugin);
|
|
|
|
SwitchWorkspaceData *sw_data = g_new (SwitchWorkspaceData, 1);
|
2009-01-28 15:43:36 +00:00
|
|
|
ClutterAnimation *animation;
|
2008-12-17 09:33:56 +00:00
|
|
|
|
|
|
|
sw_data->plugin = plugin;
|
|
|
|
sw_data->actors = actors;
|
2008-10-09 12:22:32 +00:00
|
|
|
|
2008-10-16 22:02:34 +00:00
|
|
|
stage = mutter_plugin_get_stage (plugin);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-10-16 22:02:34 +00:00
|
|
|
mutter_plugin_query_screen_size (plugin,
|
2008-10-13 11:23:47 +00:00
|
|
|
&screen_width,
|
|
|
|
&screen_height);
|
|
|
|
clutter_actor_set_anchor_point (workspace1,
|
|
|
|
screen_width,
|
|
|
|
screen_height);
|
|
|
|
clutter_actor_set_position (workspace1,
|
|
|
|
screen_width,
|
|
|
|
screen_height);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-10-13 11:23:47 +00:00
|
|
|
clutter_actor_set_scale (workspace1, 0.0, 0.0);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-10-13 11:23:47 +00:00
|
|
|
clutter_container_add_actor (CLUTTER_CONTAINER (stage), workspace1);
|
|
|
|
clutter_container_add_actor (CLUTTER_CONTAINER (stage), workspace0);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
if (from == to)
|
|
|
|
{
|
2008-12-17 09:33:56 +00:00
|
|
|
mutter_plugin_effect_completed (plugin, NULL,
|
2008-10-16 11:50:01 +00:00
|
|
|
MUTTER_PLUGIN_SWITCH_WORKSPACE);
|
2008-09-18 15:09:11 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-12-17 09:33:56 +00:00
|
|
|
n_workspaces = meta_screen_get_n_workspaces (screen);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
l = g_list_last (*((GList**) actors));
|
|
|
|
|
|
|
|
while (l)
|
|
|
|
{
|
2008-10-16 11:50:01 +00:00
|
|
|
MutterWindow *mc_window = l->data;
|
2008-12-17 09:33:56 +00:00
|
|
|
ActorPrivate *apriv = get_actor_private (mc_window);
|
2008-10-16 22:29:24 +00:00
|
|
|
ClutterActor *window = CLUTTER_ACTOR (mc_window);
|
|
|
|
gint win_workspace;
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-10-16 11:50:01 +00:00
|
|
|
win_workspace = mutter_window_get_workspace (mc_window);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-10-13 11:23:47 +00:00
|
|
|
if (win_workspace == to || win_workspace == from)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
2008-12-17 09:33:56 +00:00
|
|
|
apriv->orig_parent = clutter_actor_get_parent (window);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-10-13 11:23:47 +00:00
|
|
|
clutter_actor_reparent (window,
|
|
|
|
win_workspace == to ? workspace1 : workspace0);
|
|
|
|
clutter_actor_show_all (window);
|
|
|
|
clutter_actor_raise_top (window);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
2008-10-13 11:23:47 +00:00
|
|
|
else if (win_workspace < 0)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
|
|
|
/* Sticky window */
|
2008-12-17 09:33:56 +00:00
|
|
|
apriv->orig_parent = NULL;
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Window on some other desktop */
|
2008-10-13 11:23:47 +00:00
|
|
|
clutter_actor_hide (window);
|
2008-12-17 09:33:56 +00:00
|
|
|
apriv->orig_parent = NULL;
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
l = l->prev;
|
|
|
|
}
|
|
|
|
|
2008-12-17 09:33:56 +00:00
|
|
|
priv->actors = (GList **)actors;
|
|
|
|
priv->desktop1 = workspace0;
|
|
|
|
priv->desktop2 = workspace1;
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2009-01-28 15:43:36 +00:00
|
|
|
animation = clutter_actor_animate (workspace0, CLUTTER_EASE_IN_SINE,
|
|
|
|
SWITCH_TIMEOUT,
|
|
|
|
"scale-x", 1.0,
|
|
|
|
"scale-y", 1.0,
|
|
|
|
NULL);
|
|
|
|
priv->tml_switch_workspace1 = clutter_animation_get_timeline (animation);
|
|
|
|
g_signal_connect (priv->tml_switch_workspace1,
|
|
|
|
"completed",
|
|
|
|
G_CALLBACK (on_switch_workspace_effect_complete),
|
|
|
|
sw_data);
|
|
|
|
|
|
|
|
animation = clutter_actor_animate (workspace1, CLUTTER_EASE_IN_SINE,
|
|
|
|
SWITCH_TIMEOUT,
|
|
|
|
"scale-x", 0.0,
|
|
|
|
"scale-y", 0.0,
|
|
|
|
NULL);
|
|
|
|
priv->tml_switch_workspace2 = clutter_animation_get_timeline (animation);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Minimize effect completion callback; this function restores actor state, and
|
|
|
|
* calls the manager callback function.
|
|
|
|
*/
|
|
|
|
static void
|
2009-01-28 15:43:36 +00:00
|
|
|
on_minimize_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Must reverse the effect of the effect; must hide it first to ensure
|
|
|
|
* that the restoration will not be visible.
|
|
|
|
*/
|
2009-01-28 15:43:36 +00:00
|
|
|
MutterPlugin *plugin = data->plugin;
|
2008-10-16 22:29:24 +00:00
|
|
|
ActorPrivate *apriv;
|
2009-01-28 15:43:36 +00:00
|
|
|
MutterWindow *mc_window = MUTTER_WINDOW (data->actor);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2009-01-28 15:43:36 +00:00
|
|
|
apriv = get_actor_private (MUTTER_WINDOW (data->actor));
|
2008-09-18 15:09:11 +00:00
|
|
|
apriv->tml_minimize = NULL;
|
|
|
|
|
2009-01-28 15:43:36 +00:00
|
|
|
clutter_actor_hide (data->actor);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-10-13 11:23:47 +00:00
|
|
|
/* FIXME - we shouldn't assume the original scale, it should be saved
|
|
|
|
* at the start of the effect */
|
2009-01-28 15:43:36 +00:00
|
|
|
clutter_actor_set_scale (data->actor, 1.0, 1.0);
|
|
|
|
clutter_actor_move_anchor_point_from_gravity (data->actor,
|
2008-09-18 15:09:11 +00:00
|
|
|
CLUTTER_GRAVITY_NORTH_WEST);
|
|
|
|
|
|
|
|
/* Now notify the manager that we are done with this effect */
|
2008-12-17 09:33:56 +00:00
|
|
|
mutter_plugin_effect_completed (plugin, mc_window,
|
2008-10-17 06:25:18 +00:00
|
|
|
MUTTER_PLUGIN_MINIMIZE);
|
2009-01-28 15:43:36 +00:00
|
|
|
|
|
|
|
g_free (data);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Simple minimize handler: it applies a scale effect (which must be reversed on
|
|
|
|
* completion).
|
|
|
|
*/
|
|
|
|
static void
|
2008-12-17 09:33:56 +00:00
|
|
|
minimize (MutterPlugin *plugin, MutterWindow *mc_window)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
2008-12-17 09:33:56 +00:00
|
|
|
MetaCompWindowType type;
|
|
|
|
ClutterActor *actor = CLUTTER_ACTOR (mc_window);
|
|
|
|
|
2008-10-16 11:50:01 +00:00
|
|
|
type = mutter_window_get_window_type (mc_window);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
if (type == META_COMP_WINDOW_NORMAL)
|
|
|
|
{
|
2009-01-28 15:43:36 +00:00
|
|
|
ClutterAnimation *animation;
|
|
|
|
EffectCompleteData *data = g_new0 (EffectCompleteData, 1);
|
2008-10-16 22:29:24 +00:00
|
|
|
ActorPrivate *apriv = get_actor_private (mc_window);
|
2008-10-07 15:29:03 +00:00
|
|
|
|
2008-09-18 15:09:11 +00:00
|
|
|
apriv->is_minimized = TRUE;
|
|
|
|
|
|
|
|
clutter_actor_move_anchor_point_from_gravity (actor,
|
|
|
|
CLUTTER_GRAVITY_CENTER);
|
|
|
|
|
2009-01-28 15:43:36 +00:00
|
|
|
animation = clutter_actor_animate (actor,
|
|
|
|
CLUTTER_EASE_IN_SINE,
|
|
|
|
MINIMIZE_TIMEOUT,
|
|
|
|
"scale-x", 0.0,
|
|
|
|
"scale-y", 0.0,
|
|
|
|
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);
|
|
|
|
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
2008-10-08 15:01:04 +00:00
|
|
|
else
|
2008-12-17 09:33:56 +00:00
|
|
|
mutter_plugin_effect_completed (plugin, mc_window,
|
2008-10-16 22:29:24 +00:00
|
|
|
MUTTER_PLUGIN_MINIMIZE);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Minimize effect completion callback; this function restores actor state, and
|
|
|
|
* calls the manager callback function.
|
|
|
|
*/
|
|
|
|
static void
|
2009-01-28 15:43:36 +00:00
|
|
|
on_maximize_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Must reverse the effect of the effect.
|
|
|
|
*/
|
2009-01-28 15:43:36 +00:00
|
|
|
MutterPlugin * plugin = data->plugin;
|
|
|
|
MutterWindow *mc_window = MUTTER_WINDOW (data->actor);
|
2008-10-16 22:29:24 +00:00
|
|
|
ActorPrivate *apriv = get_actor_private (mc_window);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
apriv->tml_maximize = NULL;
|
|
|
|
|
2008-10-13 11:23:47 +00:00
|
|
|
/* FIXME - don't assume the original scale was 1.0 */
|
2009-01-28 15:43:36 +00:00
|
|
|
clutter_actor_set_scale (data->actor, 1.0, 1.0);
|
|
|
|
clutter_actor_move_anchor_point_from_gravity (data->actor,
|
2008-09-18 15:09:11 +00:00
|
|
|
CLUTTER_GRAVITY_NORTH_WEST);
|
|
|
|
|
|
|
|
/* Now notify the manager that we are done with this effect */
|
2008-12-17 09:33:56 +00:00
|
|
|
mutter_plugin_effect_completed (plugin, mc_window,
|
2008-10-17 06:25:18 +00:00
|
|
|
MUTTER_PLUGIN_MAXIMIZE);
|
2009-01-28 15:43:36 +00:00
|
|
|
|
|
|
|
g_free (data);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The Nature of Maximize operation is such that it is difficult to do a visual
|
|
|
|
* effect that would work well. Scaling, the obvious effect, does not work that
|
|
|
|
* well, because at the end of the effect we end up with window content bigger
|
|
|
|
* and differently laid out than in the real window; this is a proof concept.
|
|
|
|
*
|
|
|
|
* (Something like a sound would be more appropriate.)
|
|
|
|
*/
|
|
|
|
static void
|
2008-12-17 09:33:56 +00:00
|
|
|
maximize (MutterPlugin *plugin,
|
|
|
|
MutterWindow *mc_window,
|
2008-09-18 15:09:11 +00:00
|
|
|
gint end_x, gint end_y, gint end_width, gint end_height)
|
|
|
|
{
|
2008-10-16 22:29:24 +00:00
|
|
|
MetaCompWindowType type;
|
|
|
|
ClutterActor *actor = CLUTTER_ACTOR (mc_window);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
gdouble scale_x = 1.0;
|
|
|
|
gdouble scale_y = 1.0;
|
2009-06-06 17:14:34 +00:00
|
|
|
gfloat anchor_x = 0;
|
|
|
|
gfloat anchor_y = 0;
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-10-16 11:50:01 +00:00
|
|
|
type = mutter_window_get_window_type (mc_window);
|
2008-10-07 15:29:03 +00:00
|
|
|
|
2008-09-18 15:09:11 +00:00
|
|
|
if (type == META_COMP_WINDOW_NORMAL)
|
|
|
|
{
|
2009-01-28 15:43:36 +00:00
|
|
|
ClutterAnimation *animation;
|
|
|
|
EffectCompleteData *data = g_new0 (EffectCompleteData, 1);
|
2008-10-16 22:29:24 +00:00
|
|
|
ActorPrivate *apriv = get_actor_private (mc_window);
|
2009-06-06 17:14:34 +00:00
|
|
|
gfloat width, height;
|
|
|
|
gfloat x, y;
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
apriv->is_maximized = TRUE;
|
|
|
|
|
|
|
|
clutter_actor_get_size (actor, &width, &height);
|
|
|
|
clutter_actor_get_position (actor, &x, &y);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Work out the scale and anchor point so that the window is expanding
|
|
|
|
* smoothly into the target size.
|
|
|
|
*/
|
|
|
|
scale_x = (gdouble)end_width / (gdouble) width;
|
|
|
|
scale_y = (gdouble)end_height / (gdouble) height;
|
|
|
|
|
|
|
|
anchor_x = (gdouble)(x - end_x)*(gdouble)width /
|
|
|
|
((gdouble)(end_width - width));
|
|
|
|
anchor_y = (gdouble)(y - end_y)*(gdouble)height /
|
|
|
|
((gdouble)(end_height - height));
|
|
|
|
|
|
|
|
clutter_actor_move_anchor_point (actor, anchor_x, anchor_y);
|
|
|
|
|
2009-01-28 15:43:36 +00:00
|
|
|
animation = clutter_actor_animate (actor,
|
|
|
|
CLUTTER_EASE_IN_SINE,
|
|
|
|
MAXIMIZE_TIMEOUT,
|
|
|
|
"scale-x", scale_x,
|
|
|
|
"scale-y", scale_y,
|
|
|
|
NULL);
|
|
|
|
apriv->tml_maximize = clutter_animation_get_timeline (animation);
|
|
|
|
data->plugin = plugin;
|
|
|
|
data->actor = actor;
|
|
|
|
g_signal_connect (apriv->tml_maximize, "completed",
|
|
|
|
G_CALLBACK (on_maximize_effect_complete),
|
|
|
|
data);
|
2008-09-18 15:09:11 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-12-17 09:33:56 +00:00
|
|
|
mutter_plugin_effect_completed (plugin, mc_window,
|
2008-10-16 22:29:24 +00:00
|
|
|
MUTTER_PLUGIN_MAXIMIZE);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* See comments on the maximize() function.
|
|
|
|
*
|
|
|
|
* (Just a skeleton code.)
|
|
|
|
*/
|
|
|
|
static void
|
2008-12-17 09:33:56 +00:00
|
|
|
unmaximize (MutterPlugin *plugin,
|
|
|
|
MutterWindow *mc_window,
|
2008-09-18 15:09:11 +00:00
|
|
|
gint end_x, gint end_y, gint end_width, gint end_height)
|
|
|
|
{
|
2008-10-16 11:50:01 +00:00
|
|
|
MetaCompWindowType type = mutter_window_get_window_type (mc_window);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
if (type == META_COMP_WINDOW_NORMAL)
|
|
|
|
{
|
2008-10-16 22:29:24 +00:00
|
|
|
ActorPrivate *apriv = get_actor_private (mc_window);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
apriv->is_maximized = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Do this conditionally, if the effect requires completion callback. */
|
2008-12-17 09:33:56 +00:00
|
|
|
mutter_plugin_effect_completed (plugin, mc_window,
|
2008-10-16 22:29:24 +00:00
|
|
|
MUTTER_PLUGIN_UNMAXIMIZE);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2009-01-28 15:43:36 +00:00
|
|
|
on_map_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Must reverse the effect of the effect.
|
|
|
|
*/
|
2009-01-28 15:43:36 +00:00
|
|
|
MutterPlugin *plugin = data->plugin;
|
|
|
|
MutterWindow *mc_window = MUTTER_WINDOW (data->actor);
|
2008-10-16 22:29:24 +00:00
|
|
|
ActorPrivate *apriv = get_actor_private (mc_window);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
apriv->tml_map = NULL;
|
|
|
|
|
2009-01-28 15:43:36 +00:00
|
|
|
clutter_actor_move_anchor_point_from_gravity (data->actor,
|
2008-09-18 15:09:11 +00:00
|
|
|
CLUTTER_GRAVITY_NORTH_WEST);
|
|
|
|
|
|
|
|
/* Now notify the manager that we are done with this effect */
|
2008-12-17 09:33:56 +00:00
|
|
|
mutter_plugin_effect_completed (plugin, mc_window, MUTTER_PLUGIN_MAP);
|
2009-01-28 15:43:36 +00:00
|
|
|
|
|
|
|
g_free (data);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Simple map handler: it applies a scale effect which must be reversed on
|
|
|
|
* completion).
|
|
|
|
*/
|
|
|
|
static void
|
2008-12-17 09:33:56 +00:00
|
|
|
map (MutterPlugin *plugin, MutterWindow *mc_window)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
2008-10-16 22:29:24 +00:00
|
|
|
MetaCompWindowType type;
|
|
|
|
ClutterActor *actor = CLUTTER_ACTOR (mc_window);
|
2008-10-07 15:29:03 +00:00
|
|
|
|
2008-10-16 11:50:01 +00:00
|
|
|
type = mutter_window_get_window_type (mc_window);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
if (type == META_COMP_WINDOW_NORMAL)
|
|
|
|
{
|
2009-01-28 15:43:36 +00:00
|
|
|
ClutterAnimation *animation;
|
|
|
|
EffectCompleteData *data = g_new0 (EffectCompleteData, 1);
|
2008-10-16 22:29:24 +00:00
|
|
|
ActorPrivate *apriv = get_actor_private (mc_window);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
clutter_actor_move_anchor_point_from_gravity (actor,
|
|
|
|
CLUTTER_GRAVITY_CENTER);
|
|
|
|
|
|
|
|
clutter_actor_set_scale (actor, 0.0, 0.0);
|
|
|
|
clutter_actor_show (actor);
|
|
|
|
|
2009-01-28 15:43:36 +00:00
|
|
|
animation = clutter_actor_animate (actor,
|
|
|
|
CLUTTER_EASE_IN_SINE,
|
|
|
|
MAP_TIMEOUT,
|
|
|
|
"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);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
apriv->is_minimized = FALSE;
|
|
|
|
|
|
|
|
}
|
2008-10-08 15:01:04 +00:00
|
|
|
else
|
2008-12-17 09:33:56 +00:00
|
|
|
mutter_plugin_effect_completed (plugin, mc_window,
|
2008-10-16 22:29:24 +00:00
|
|
|
MUTTER_PLUGIN_MAP);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Destroy effect completion callback; this is a simple effect that requires no
|
2008-10-17 16:10:15 +00:00
|
|
|
* further action than notifying the manager that the effect is completed.
|
2008-09-18 15:09:11 +00:00
|
|
|
*/
|
|
|
|
static void
|
2009-01-28 15:43:36 +00:00
|
|
|
on_destroy_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
2009-01-28 15:43:36 +00:00
|
|
|
MutterPlugin *plugin = data->plugin;
|
|
|
|
MutterWindow *mc_window = MUTTER_WINDOW (data->actor);
|
2008-10-16 22:29:24 +00:00
|
|
|
ActorPrivate *apriv = get_actor_private (mc_window);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
apriv->tml_destroy = NULL;
|
|
|
|
|
2008-10-16 22:02:34 +00:00
|
|
|
mutter_plugin_effect_completed (plugin, mc_window,
|
2008-10-17 06:25:18 +00:00
|
|
|
MUTTER_PLUGIN_DESTROY);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Simple TV-out like effect.
|
|
|
|
*/
|
|
|
|
static void
|
2008-12-17 09:33:56 +00:00
|
|
|
destroy (MutterPlugin *plugin, MutterWindow *mc_window)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
2008-10-13 11:23:47 +00:00
|
|
|
MetaCompWindowType type;
|
|
|
|
ClutterActor *actor = CLUTTER_ACTOR (mc_window);
|
2008-10-07 15:29:03 +00:00
|
|
|
|
2008-10-16 11:50:01 +00:00
|
|
|
type = mutter_window_get_window_type (mc_window);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
if (type == META_COMP_WINDOW_NORMAL)
|
|
|
|
{
|
2009-01-28 15:43:36 +00:00
|
|
|
ClutterAnimation *animation;
|
|
|
|
EffectCompleteData *data = g_new0 (EffectCompleteData, 1);
|
2008-10-16 22:29:24 +00:00
|
|
|
ActorPrivate *apriv = get_actor_private (mc_window);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
|
|
|
clutter_actor_move_anchor_point_from_gravity (actor,
|
|
|
|
CLUTTER_GRAVITY_CENTER);
|
|
|
|
|
2009-01-28 15:43:36 +00:00
|
|
|
animation = clutter_actor_animate (actor,
|
|
|
|
CLUTTER_EASE_IN_SINE,
|
|
|
|
DESTROY_TIMEOUT,
|
|
|
|
"scale-x", 0.0,
|
|
|
|
"scale-y", 1.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);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
2008-10-08 15:01:04 +00:00
|
|
|
else
|
2008-12-17 09:33:56 +00:00
|
|
|
mutter_plugin_effect_completed (plugin, mc_window,
|
2008-10-16 22:29:24 +00:00
|
|
|
MUTTER_PLUGIN_DESTROY);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-12-17 09:33:56 +00:00
|
|
|
kill_effect (MutterPlugin *plugin, MutterWindow *mc_window, gulong event)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
2008-10-16 22:29:24 +00:00
|
|
|
ActorPrivate *apriv;
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-10-16 11:50:01 +00:00
|
|
|
if (event & MUTTER_PLUGIN_SWITCH_WORKSPACE)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
2008-12-17 09:33:56 +00:00
|
|
|
MutterDefaultPluginPrivate *priv = MUTTER_DEFAULT_PLUGIN (plugin)->priv;
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-12-17 09:33:56 +00:00
|
|
|
if (priv->tml_switch_workspace1)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
2008-12-17 09:33:56 +00:00
|
|
|
clutter_timeline_stop (priv->tml_switch_workspace1);
|
|
|
|
clutter_timeline_stop (priv->tml_switch_workspace2);
|
2009-01-28 15:43:36 +00:00
|
|
|
g_signal_emit_by_name (priv->tml_switch_workspace1, "completed", NULL);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
|
2008-10-16 11:50:01 +00:00
|
|
|
if (!(event & ~MUTTER_PLUGIN_SWITCH_WORKSPACE))
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
|
|
|
/* Workspace switch only, nothing more to do */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-10-13 11:23:47 +00:00
|
|
|
apriv = get_actor_private (mc_window);
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-10-16 11:50:01 +00:00
|
|
|
if ((event & MUTTER_PLUGIN_MINIMIZE) && apriv->tml_minimize)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
|
|
|
clutter_timeline_stop (apriv->tml_minimize);
|
2009-01-28 15:43:36 +00:00
|
|
|
g_signal_emit_by_name (apriv->tml_minimize, "completed", NULL);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
|
2008-10-16 11:50:01 +00:00
|
|
|
if ((event & MUTTER_PLUGIN_MAXIMIZE) && apriv->tml_maximize)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
|
|
|
clutter_timeline_stop (apriv->tml_maximize);
|
2009-01-28 15:43:36 +00:00
|
|
|
g_signal_emit_by_name (apriv->tml_maximize, "completed", NULL);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
|
2008-10-16 11:50:01 +00:00
|
|
|
if ((event & MUTTER_PLUGIN_MAP) && apriv->tml_map)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
|
|
|
clutter_timeline_stop (apriv->tml_map);
|
2009-01-28 15:43:36 +00:00
|
|
|
g_signal_emit_by_name (apriv->tml_map, "completed", NULL);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
|
2008-10-16 11:50:01 +00:00
|
|
|
if ((event & MUTTER_PLUGIN_DESTROY) && apriv->tml_destroy)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
|
|
|
clutter_timeline_stop (apriv->tml_destroy);
|
2009-01-28 15:43:36 +00:00
|
|
|
g_signal_emit_by_name (apriv->tml_destroy, "completed", NULL);
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-17 09:33:56 +00:00
|
|
|
static const MutterPluginInfo *
|
|
|
|
plugin_info (MutterPlugin *plugin)
|
2008-09-18 15:09:11 +00:00
|
|
|
{
|
2008-12-17 09:33:56 +00:00
|
|
|
MutterDefaultPluginPrivate *priv = MUTTER_DEFAULT_PLUGIN (plugin)->priv;
|
2008-09-18 15:09:11 +00:00
|
|
|
|
2008-12-17 09:33:56 +00:00
|
|
|
return &priv->info;
|
2008-09-18 15:09:11 +00:00
|
|
|
}
|