From 04bf73ff6df6bb35d44026112e2ccd93ee084021 Mon Sep 17 00:00:00 2001 From: Damien Radtke Date: Fri, 6 Jan 2012 20:04:00 +0000 Subject: [PATCH] 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 --- src/compositor/plugins/default.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/compositor/plugins/default.c b/src/compositor/plugins/default.c index d21f4d919..b7bb63b4a 100644 --- a/src/compositor/plugins/default.c +++ b/src/compositor/plugins/default.c @@ -450,12 +450,19 @@ static void minimize (MetaPlugin *plugin, MetaWindowActor *window_actor) { MetaWindowType type; + MetaRectangle icon_geometry; MetaWindow *meta_window = meta_window_actor_get_meta_window (window_actor); ClutterActor *actor = CLUTTER_ACTOR (window_actor); 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) { ClutterAnimation *animation; @@ -472,6 +479,8 @@ minimize (MetaPlugin *plugin, MetaWindowActor *window_actor) MINIMIZE_TIMEOUT, "scale-x", 0.0, "scale-y", 0.0, + "x", icon_geometry.x, + "y", icon_geometry.y, NULL); apriv->tml_minimize = clutter_animation_get_timeline (animation); data->plugin = plugin;