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
This commit is contained in:
Owen W. Taylor 2009-06-28 15:06:58 -04:00
parent 9244f0f113
commit 5d477c4b4e
3 changed files with 12 additions and 11 deletions

View File

@ -873,7 +873,7 @@ meta_compositor_sync_stack (MetaCompositor *compositor,
old_window = mutter_window_get_meta_window (old_actor); old_window = mutter_window_get_meta_window (old_actor);
if (old_window->hidden && 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); old_stack = g_list_delete_link (old_stack, old_stack);
else else
break; break;

View File

@ -24,8 +24,7 @@ void mutter_window_process_damage (MutterWindow *cw,
XDamageNotifyEvent *event); XDamageNotifyEvent *event);
void mutter_window_pre_paint (MutterWindow *self); void mutter_window_pre_paint (MutterWindow *self);
gboolean mutter_window_effect_in_progress (MutterWindow *cw, gboolean mutter_window_effect_in_progress (MutterWindow *cw);
gboolean include_destroy);
void mutter_window_sync_actor_position (MutterWindow *cw); void mutter_window_sync_actor_position (MutterWindow *cw);
void mutter_window_finish_workspace_switch (MutterWindow *cw); void mutter_window_finish_workspace_switch (MutterWindow *cw);
void mutter_window_update_window_type (MutterWindow *cw); void mutter_window_update_window_type (MutterWindow *cw);

View File

@ -730,14 +730,13 @@ mutter_window_showing_on_its_workspace (MutterWindow *self)
} }
gboolean gboolean
mutter_window_effect_in_progress (MutterWindow *self, mutter_window_effect_in_progress (MutterWindow *self)
gboolean include_destroy)
{ {
return (self->priv->minimize_in_progress || return (self->priv->minimize_in_progress ||
self->priv->maximize_in_progress || self->priv->maximize_in_progress ||
self->priv->unmaximize_in_progress || self->priv->unmaximize_in_progress ||
self->priv->map_in_progress || self->priv->map_in_progress ||
(include_destroy && self->priv->destroy_in_progress)); self->priv->destroy_in_progress);
} }
static void static void
@ -899,7 +898,7 @@ mutter_window_effect_completed (MutterWindow *self,
if (effect_done && if (effect_done &&
priv->hide_after_effect && 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) 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; 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)); clutter_actor_destroy (CLUTTER_ACTOR (self));
return; return;
@ -953,6 +952,7 @@ mutter_window_destroy (MutterWindow *self)
MetaWindow *window; MetaWindow *window;
MetaCompScreen *info; MetaCompScreen *info;
MutterWindowPrivate *priv; MutterWindowPrivate *priv;
gboolean effect_in_progress;
priv = self->priv; priv = self->priv;
@ -982,6 +982,8 @@ mutter_window_destroy (MutterWindow *self)
return; 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 * If a plugin manager is present, try to run an effect; if no effect of this
* type is present, destroy the actor. * type is present, destroy the actor.
@ -1003,7 +1005,7 @@ mutter_window_destroy (MutterWindow *self)
{ {
priv->destroy_in_progress--; priv->destroy_in_progress--;
if (mutter_window_effect_in_progress (self, FALSE)) if (effect_in_progress)
{ {
priv->needs_destroy = TRUE; priv->needs_destroy = TRUE;
} }
@ -1033,7 +1035,7 @@ mutter_window_sync_actor_position (MutterWindow *self)
priv->attrs.x = window_rect.x; priv->attrs.x = window_rect.x;
priv->attrs.y = window_rect.y; priv->attrs.y = window_rect.y;
if (mutter_window_effect_in_progress (self, FALSE)) if (mutter_window_effect_in_progress (self))
return; return;
clutter_actor_set_position (CLUTTER_ACTOR (self), clutter_actor_set_position (CLUTTER_ACTOR (self),
@ -1538,7 +1540,7 @@ mutter_window_set_hidden (MutterWindow *self,
if (hidden) if (hidden)
{ {
if (mutter_window_effect_in_progress (self, TRUE)) if (mutter_window_effect_in_progress (self))
{ {
priv->hide_after_effect = TRUE; priv->hide_after_effect = TRUE;
} }