1
0
Fork 0

default plugin: animate minimization to icon geometry

Instead of minimizing windows in place, minimize them to the icon
geometry for the window (if set), or to the upper-left corner if
it's not set.

https://bugzilla.gnome.org/show_bug.cgi?id=667437
This commit is contained in:
Damien Radtke 2012-01-06 20:04:00 +00:00 committed by Owen W. Taylor
parent 047b9de1c6
commit 04bf73ff6d

View file

@ -450,12 +450,19 @@ static void
minimize (MetaPlugin *plugin, MetaWindowActor *window_actor) minimize (MetaPlugin *plugin, MetaWindowActor *window_actor)
{ {
MetaWindowType type; MetaWindowType type;
MetaRectangle icon_geometry;
MetaWindow *meta_window = meta_window_actor_get_meta_window (window_actor); MetaWindow *meta_window = meta_window_actor_get_meta_window (window_actor);
ClutterActor *actor = CLUTTER_ACTOR (window_actor); ClutterActor *actor = CLUTTER_ACTOR (window_actor);
type = meta_window_get_window_type (meta_window); 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) if (type == META_WINDOW_NORMAL)
{ {
ClutterAnimation *animation; ClutterAnimation *animation;
@ -472,6 +479,8 @@ minimize (MetaPlugin *plugin, MetaWindowActor *window_actor)
MINIMIZE_TIMEOUT, MINIMIZE_TIMEOUT,
"scale-x", 0.0, "scale-x", 0.0,
"scale-y", 0.0, "scale-y", 0.0,
"x", icon_geometry.x,
"y", icon_geometry.y,
NULL); NULL);
apriv->tml_minimize = clutter_animation_get_timeline (animation); apriv->tml_minimize = clutter_animation_get_timeline (animation);
data->plugin = plugin; data->plugin = plugin;