From 28378f1bb4f74c4ba97618f404386b26a28f5224 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 9 Aug 2010 11:06:44 +0100 Subject: [PATCH] layout-manager: Do not emit layout-changed on thaw When thawing a LayoutManager, do not emit the ::layout-changed signal since it might still be in the middle of a relayout. http://bugzilla.clutter-project.org/show_bug.cgi?id=2255 --- clutter/clutter-layout-manager.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/clutter/clutter-layout-manager.c b/clutter/clutter-layout-manager.c index b34c71947..6e185babb 100644 --- a/clutter/clutter-layout-manager.c +++ b/clutter/clutter-layout-manager.c @@ -325,6 +325,10 @@ layout_manager_freeze_layout_change (ClutterLayoutManager *manager) { gpointer is_frozen; + CLUTTER_NOTE (LAYOUT, "Freezing changes for manager '%s'[%p]", + G_OBJECT_TYPE_NAME (manager), + manager); + is_frozen = g_object_get_data (G_OBJECT (manager), "freeze-change"); if (is_frozen == NULL) g_object_set_data (G_OBJECT (manager), "freeze-change", @@ -354,12 +358,13 @@ layout_manager_thaw_layout_change (ClutterLayoutManager *manager) g_assert (level > 0); + CLUTTER_NOTE (LAYOUT, "Thawing changes for manager '%s'[%p]", + G_OBJECT_TYPE_NAME (manager), + manager); + level -= 1; if (level == 0) - { - g_object_set_data (G_OBJECT (manager), "freeze-change", NULL); - clutter_layout_manager_layout_changed (manager); - } + g_object_set_data (G_OBJECT (manager), "freeze-change", NULL); else g_object_set_data (G_OBJECT (manager), "freeze-change", GUINT_TO_POINTER (level)); @@ -715,6 +720,10 @@ clutter_layout_manager_layout_changed (ClutterLayoutManager *manager) is_frozen = g_object_get_data (G_OBJECT (manager), "freeze-change"); if (is_frozen == NULL) g_signal_emit (manager, manager_signals[LAYOUT_CHANGED], 0); + else + CLUTTER_NOTE (LAYOUT, "Layout manager '%s'[%p] has been frozen", + G_OBJECT_TYPE_NAME (manager), + manager); } /**