From 5d477c4b4e6a4dfe17c418ba91005cfe598461a0 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Sun, 28 Jun 2009 15:06:58 -0400 Subject: [PATCH] Remove include_destroy parameter to mutter_window_effect_in_progress() Clean up mutter_window_effect_in_progress() by removing the include_destroy parameter which was used only in one place that could be easily done otherwise. (There was another use in mutter_window_sync_actor_position() that had no point and looked unintended.) http://bugzilla.gnome.org/show_bug.cgi?id=587251 --- src/compositor/compositor.c | 2 +- src/compositor/mutter-window-private.h | 3 +-- src/compositor/mutter-window.c | 18 ++++++++++-------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index 13c5fe9a0..46b097aee 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -873,7 +873,7 @@ meta_compositor_sync_stack (MetaCompositor *compositor, old_window = mutter_window_get_meta_window (old_actor); if (old_window->hidden && - !mutter_window_effect_in_progress (old_actor, TRUE)) + !mutter_window_effect_in_progress (old_actor)) old_stack = g_list_delete_link (old_stack, old_stack); else break; diff --git a/src/compositor/mutter-window-private.h b/src/compositor/mutter-window-private.h index 8dfa4b319..abf5be352 100644 --- a/src/compositor/mutter-window-private.h +++ b/src/compositor/mutter-window-private.h @@ -24,8 +24,7 @@ void mutter_window_process_damage (MutterWindow *cw, XDamageNotifyEvent *event); void mutter_window_pre_paint (MutterWindow *self); -gboolean mutter_window_effect_in_progress (MutterWindow *cw, - gboolean include_destroy); +gboolean mutter_window_effect_in_progress (MutterWindow *cw); void mutter_window_sync_actor_position (MutterWindow *cw); void mutter_window_finish_workspace_switch (MutterWindow *cw); void mutter_window_update_window_type (MutterWindow *cw); diff --git a/src/compositor/mutter-window.c b/src/compositor/mutter-window.c index 13ff437d2..0333303c2 100644 --- a/src/compositor/mutter-window.c +++ b/src/compositor/mutter-window.c @@ -730,14 +730,13 @@ mutter_window_showing_on_its_workspace (MutterWindow *self) } gboolean -mutter_window_effect_in_progress (MutterWindow *self, - gboolean include_destroy) +mutter_window_effect_in_progress (MutterWindow *self) { return (self->priv->minimize_in_progress || self->priv->maximize_in_progress || self->priv->unmaximize_in_progress || self->priv->map_in_progress || - (include_destroy && self->priv->destroy_in_progress)); + self->priv->destroy_in_progress); } static void @@ -899,7 +898,7 @@ mutter_window_effect_completed (MutterWindow *self, if (effect_done && priv->hide_after_effect && - mutter_window_effect_in_progress (self, TRUE) == FALSE) + mutter_window_effect_in_progress (self) == FALSE) { if (clutter_actor_get_parent (CLUTTER_ACTOR (self)) != info->hidden_group) { @@ -909,7 +908,7 @@ mutter_window_effect_completed (MutterWindow *self, priv->hide_after_effect = FALSE; } - if (priv->needs_destroy && mutter_window_effect_in_progress (self, TRUE) == FALSE) + if (priv->needs_destroy && mutter_window_effect_in_progress (self) == FALSE) { clutter_actor_destroy (CLUTTER_ACTOR (self)); return; @@ -953,6 +952,7 @@ mutter_window_destroy (MutterWindow *self) MetaWindow *window; MetaCompScreen *info; MutterWindowPrivate *priv; + gboolean effect_in_progress; priv = self->priv; @@ -982,6 +982,8 @@ mutter_window_destroy (MutterWindow *self) return; } + effect_in_progress = mutter_window_effect_in_progress (self); + /* * If a plugin manager is present, try to run an effect; if no effect of this * type is present, destroy the actor. @@ -1003,7 +1005,7 @@ mutter_window_destroy (MutterWindow *self) { priv->destroy_in_progress--; - if (mutter_window_effect_in_progress (self, FALSE)) + if (effect_in_progress) { priv->needs_destroy = TRUE; } @@ -1033,7 +1035,7 @@ mutter_window_sync_actor_position (MutterWindow *self) priv->attrs.x = window_rect.x; priv->attrs.y = window_rect.y; - if (mutter_window_effect_in_progress (self, FALSE)) + if (mutter_window_effect_in_progress (self)) return; clutter_actor_set_position (CLUTTER_ACTOR (self), @@ -1538,7 +1540,7 @@ mutter_window_set_hidden (MutterWindow *self, if (hidden) { - if (mutter_window_effect_in_progress (self, TRUE)) + if (mutter_window_effect_in_progress (self)) { priv->hide_after_effect = TRUE; }