diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c index 1207f1fb7..fc8ac2c2e 100644 --- a/src/compositor/meta-window-actor.c +++ b/src/compositor/meta-window-actor.c @@ -272,11 +272,23 @@ meta_window_actor_set_frozen (MetaWindowActor *self, META_WINDOW_ACTOR_GET_CLASS (self)->set_frozen (self, frozen); } -static void +/** + * meta_window_actor_freeze: + * @self: The #MetaWindowActor + * + * Freezes the #MetaWindowActor, which inhibits updates and geometry + * changes of the window. This property is refcounted, so make sure + * to call meta_window_actor_thaw() the exact same amount of times + * as this function to allow updates again. + */ +void meta_window_actor_freeze (MetaWindowActor *self) { - MetaWindowActorPrivate *priv = - meta_window_actor_get_instance_private (self); + MetaWindowActorPrivate *priv; + + g_return_if_fail (META_IS_WINDOW_ACTOR (self)); + + priv = meta_window_actor_get_instance_private (self); if (priv->freeze_count == 0 && priv->surface) meta_window_actor_set_frozen (self, TRUE); @@ -300,11 +312,21 @@ meta_window_actor_sync_thawed_state (MetaWindowActor *self) meta_window_actor_sync_actor_geometry (self, FALSE); } -static void +/** + * meta_window_actor_thaw: + * @self: The #MetaWindowActor + * + * Thaws/unfreezes the #MetaWindowActor to allow updates and geometry + * changes after a window was frozen using meta_window_actor_freeze(). + */ +void meta_window_actor_thaw (MetaWindowActor *self) { - MetaWindowActorPrivate *priv = - meta_window_actor_get_instance_private (self); + MetaWindowActorPrivate *priv; + + g_return_if_fail (META_IS_WINDOW_ACTOR (self)); + + priv = meta_window_actor_get_instance_private (self); if (priv->freeze_count <= 0) g_error ("Error in freeze/thaw accounting"); diff --git a/src/meta/meta-window-actor.h b/src/meta/meta-window-actor.h index 7d3b96e59..6e18683a2 100644 --- a/src/meta/meta-window-actor.h +++ b/src/meta/meta-window-actor.h @@ -51,6 +51,12 @@ META_EXPORT cairo_surface_t * meta_window_actor_get_image (MetaWindowActor *self, cairo_rectangle_int_t *clip); +META_EXPORT +void meta_window_actor_freeze (MetaWindowActor *self); + +META_EXPORT +void meta_window_actor_thaw (MetaWindowActor *self); + typedef enum { META_SHADOW_MODE_AUTO,