default: Remove the maximize effect

It looks awful, and doesn't work with Wayland at all for some
reason, which means that maximize seems to "hang" for half a
second. Just trash it.
This commit is contained in:
Jasper St. Pierre 2014-04-28 15:17:57 -04:00
parent 270c7abd3c
commit aed6d4fbb7

View File

@ -34,7 +34,6 @@
#define DESTROY_TIMEOUT 100 #define DESTROY_TIMEOUT 100
#define MINIMIZE_TIMEOUT 250 #define MINIMIZE_TIMEOUT 250
#define MAXIMIZE_TIMEOUT 250
#define MAP_TIMEOUT 250 #define MAP_TIMEOUT 250
#define SWITCH_TIMEOUT 500 #define SWITCH_TIMEOUT 500
@ -77,12 +76,6 @@ static void map (MetaPlugin *plugin,
MetaWindowActor *actor); MetaWindowActor *actor);
static void destroy (MetaPlugin *plugin, static void destroy (MetaPlugin *plugin,
MetaWindowActor *actor); MetaWindowActor *actor);
static void maximize (MetaPlugin *plugin,
MetaWindowActor *actor,
gint x,
gint y,
gint width,
gint height);
static void switch_workspace (MetaPlugin *plugin, static void switch_workspace (MetaPlugin *plugin,
gint from, gint from,
@ -129,7 +122,6 @@ typedef struct _ActorPrivate
ClutterActor *orig_parent; ClutterActor *orig_parent;
ClutterTimeline *tml_minimize; ClutterTimeline *tml_minimize;
ClutterTimeline *tml_maximize;
ClutterTimeline *tml_destroy; ClutterTimeline *tml_destroy;
ClutterTimeline *tml_map; ClutterTimeline *tml_map;
} ActorPrivate; } ActorPrivate;
@ -207,7 +199,6 @@ meta_default_plugin_class_init (MetaDefaultPluginClass *klass)
plugin_class->start = start; plugin_class->start = start;
plugin_class->map = map; plugin_class->map = map;
plugin_class->minimize = minimize; plugin_class->minimize = minimize;
plugin_class->maximize = maximize;
plugin_class->destroy = destroy; plugin_class->destroy = destroy;
plugin_class->switch_workspace = switch_workspace; plugin_class->switch_workspace = switch_workspace;
plugin_class->show_tile_preview = show_tile_preview; plugin_class->show_tile_preview = show_tile_preview;
@ -532,89 +523,6 @@ minimize (MetaPlugin *plugin, MetaWindowActor *window_actor)
meta_plugin_minimize_completed (plugin, window_actor); meta_plugin_minimize_completed (plugin, window_actor);
} }
/*
* Minimize effect completion callback; this function restores actor state, and
* calls the manager callback function.
*/
static void
on_maximize_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_maximize = NULL;
/* FIXME - don't assume the original scale was 1.0 */
clutter_actor_set_scale (data->actor, 1.0, 1.0);
/* Now notify the manager that we are done with this effect */
meta_plugin_maximize_completed (plugin, window_actor);
g_free (data);
}
/*
* 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
maximize (MetaPlugin *plugin,
MetaWindowActor *window_actor,
gint end_x, gint end_y, gint end_width, gint end_height)
{
MetaWindowType type;
ClutterActor *actor = CLUTTER_ACTOR (window_actor);
MetaWindow *meta_window = meta_window_actor_get_meta_window (window_actor);
gdouble scale_x = 1.0;
gdouble scale_y = 1.0;
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);
gfloat width, height;
gfloat x, y;
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;
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);
return;
}
meta_plugin_maximize_completed (plugin, window_actor);
}
static void static void
on_map_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data) on_map_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data)
{ {
@ -830,12 +738,6 @@ kill_window_effects (MetaPlugin *plugin,
g_signal_emit_by_name (apriv->tml_minimize, "completed", NULL); g_signal_emit_by_name (apriv->tml_minimize, "completed", NULL);
} }
if (apriv->tml_maximize)
{
clutter_timeline_stop (apriv->tml_maximize);
g_signal_emit_by_name (apriv->tml_maximize, "completed", NULL);
}
if (apriv->tml_map) if (apriv->tml_map)
{ {
clutter_timeline_stop (apriv->tml_map); clutter_timeline_stop (apriv->tml_map);