diff options
author | Søren Sandmann Pedersen <ssp@src.gnome.org> | 2005-11-28 23:04:41 +0000 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@src.gnome.org> | 2005-11-28 23:04:41 +0000 |
commit | 68810225fbfbe88b110b9fc8c6f6d2715af41d73 (patch) | |
tree | c65b738b05db529b22db0df8f3ec4fd68b5fdde1 | |
parent | 89b24dd7eb5f7c36ca0ea69459cc4e4f44be5740 (diff) | |
download | metacity-68810225fbfbe88b110b9fc8c6f6d2715af41d73.tar.gz |
*** empty log message ***
-rw-r--r-- | src/compositor.c | 26 | ||||
-rw-r--r-- | src/window.c | 7 | ||||
-rw-r--r-- | src/window.h | 2 |
3 files changed, 19 insertions, 16 deletions
diff --git a/src/compositor.c b/src/compositor.c index c2fb9aa4..f15b06af 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -29,6 +29,7 @@ #include "matrix.h" #include <math.h> #include "snow.h" +#include "workspace.h" #include <math.h> @@ -686,7 +687,9 @@ meta_compositor_add_window (MetaCompositor *compositor, { node = drawable_node_new (drawable); +#if 0 drawable_node_set_deformation_func (node, wavy, NULL); +#endif } /* FIXME: we should probably just store xid's directly */ @@ -881,6 +884,7 @@ typedef struct typedef struct { + MetaWindow *window; DrawableNode *node; DoubleRect start; @@ -893,7 +897,7 @@ typedef struct static gdouble interpolate (gdouble t, gdouble begin, gdouble end, double power) { - return begin + (end - begin) * pow (t, power); + return (begin + (end - begin) * pow (t, power)); } static gboolean @@ -902,8 +906,12 @@ stop_minimize (gpointer data) MiniInfo *info = data; drawable_node_set_deformation_func (info->node, NULL, NULL); - g_free (info); + meta_window_hide (info->window); + meta_workspace_focus_default_window (info->window->screen->active_workspace, info->window, meta_display_get_current_time_roundtrip (info->window->display)); + + g_free (info); + return FALSE; } @@ -915,7 +923,7 @@ minimize_deformation (gdouble time, double *out_y, gpointer data) { -#define MINIMIZE_TIME 3.0 +#define MINIMIZE_TIME 0.5 MiniInfo *info = data; gdouble elapsed; gdouble pos; @@ -925,18 +933,10 @@ minimize_deformation (gdouble time, elapsed = time - info->start_time; pos = elapsed / MINIMIZE_TIME; - -#if 0 - g_print ("%f\n", info->target.width * ((in_x - info->start.x) / info->start.width)); -#endif - *out_x = interpolate (pos, in_x, info->target.x + info->target.width * ((in_x - info->start.x) / info->start.width), 3 * (1 - in_y)); + *out_x = interpolate (pos, in_x, info->target.x + info->target.width * ((in_x - info->start.x) / info->start.width), 10 * (1 - in_y)); *out_y = interpolate (pos, in_y, info->target.y + info->target.height * ((in_y - info->start.y) / info->start.height), 1.0); -#if 0 - g_print ("%f %f => %f %f\n", in_x, in_y, *out_x, *out_y); -#endif - if (elapsed > MINIMIZE_TIME) { g_assert (info->node); @@ -988,6 +988,8 @@ meta_compositor_minimize (MetaCompositor *compositor, info->target.x, info->target.y, info->target.width, info->target.height); + info->window = window; + info->target.y = 1 - info->target.y - info->target.height; info->start_time = -1; diff --git a/src/window.c b/src/window.c index 7dbe3556..d3eb4f86 100644 --- a/src/window.c +++ b/src/window.c @@ -77,7 +77,6 @@ static void send_configure_notify (MetaWindow *window); static gboolean process_property_notify (MetaWindow *window, XPropertyEvent *event); static void meta_window_show (MetaWindow *window); -static void meta_window_hide (MetaWindow *window); static void meta_window_save_rect (MetaWindow *window); @@ -1335,6 +1334,7 @@ implement_showing (MetaWindow *window, meta_window_get_outer_rect (window, &window_rect); /* Draw a nice cool animation */ + window->animation_running = TRUE; meta_compositor_minimize (window->display->compositor, window, icon_rect.x, @@ -1349,8 +1349,8 @@ implement_showing (MetaWindow *window, META_BOX_ANIM_SCALE); #endif } - - meta_window_hide (window); + else + meta_window_hide (window); } else { @@ -1964,7 +1964,6 @@ meta_window_minimize (MetaWindow *window) meta_topic (META_DEBUG_FOCUS, "Focusing default window due to minimization of focus window %s\n", window->desc); - meta_workspace_focus_default_window (window->screen->active_workspace, window, meta_display_get_current_time_roundtrip (window->display)); } else { diff --git a/src/window.h b/src/window.h index 4253c96d..f364cd58 100644 --- a/src/window.h +++ b/src/window.h @@ -266,6 +266,7 @@ struct _MetaWindow /* if TRUE, application is buggy and SYNC resizing is turned off */ guint disable_sync : 1; + guint animation_running : 1; #ifdef HAVE_XSYNC /* XSync update counter */ @@ -544,5 +545,6 @@ void meta_window_stack_just_below (MetaWindow *window, void meta_window_set_user_time (MetaWindow *window, Time timestamp); +void meta_window_hide (MetaWindow *window); #endif |