Fix accounting of frozen with maximize/unmaximize

The beginning maximization/unmaximization don't go through
start_effect_simple(), so we need to freeze the window
separately.

Change MutterWindow.freeze_count to a signed integer for
consistency with other counts, and so the logic for
checking for errors works properly.

https://bugzilla.gnome.org/show_bug.cgi?id=616546
This commit is contained in:
Owen W. Taylor 2010-04-23 19:08:59 -04:00
parent e9fbe4b2c1
commit d8b0f213b2

View File

@ -47,7 +47,7 @@ struct _MutterWindowPrivate
* texture */ * texture */
GdkRegion *bounding_region; GdkRegion *bounding_region;
guint freeze_count; gint freeze_count;
/* /*
* These need to be counters rather than flags, since more plugins * These need to be counters rather than flags, since more plugins
@ -1216,6 +1216,7 @@ mutter_window_maximize (MutterWindow *self,
clutter_actor_set_size (CLUTTER_ACTOR (self), old_rect->width, old_rect->height); clutter_actor_set_size (CLUTTER_ACTOR (self), old_rect->width, old_rect->height);
self->priv->maximize_in_progress++; self->priv->maximize_in_progress++;
mutter_window_freeze (self);
if (!info->plugin_mgr || if (!info->plugin_mgr ||
!mutter_plugin_manager_event_maximize (info->plugin_mgr, !mutter_plugin_manager_event_maximize (info->plugin_mgr,
@ -1226,6 +1227,7 @@ mutter_window_maximize (MutterWindow *self,
{ {
self->priv->maximize_in_progress--; self->priv->maximize_in_progress--;
mutter_window_thaw (self);
} }
} }
@ -1243,6 +1245,7 @@ mutter_window_unmaximize (MutterWindow *self,
clutter_actor_set_size (CLUTTER_ACTOR (self), old_rect->width, old_rect->height); clutter_actor_set_size (CLUTTER_ACTOR (self), old_rect->width, old_rect->height);
self->priv->unmaximize_in_progress++; self->priv->unmaximize_in_progress++;
mutter_window_freeze (self);
if (!info->plugin_mgr || if (!info->plugin_mgr ||
!mutter_plugin_manager_event_maximize (info->plugin_mgr, !mutter_plugin_manager_event_maximize (info->plugin_mgr,
@ -1252,6 +1255,7 @@ mutter_window_unmaximize (MutterWindow *self,
new_rect->width, new_rect->height)) new_rect->width, new_rect->height))
{ {
self->priv->unmaximize_in_progress--; self->priv->unmaximize_in_progress--;
mutter_window_thaw (self);
} }
} }