[gtk+/treeview-refactor] Fixed gtk_cell_area_context_real_reset() to only notify properties if they change.



commit fa71b24e9a30f85a5ab6153ca2f4aff7792329c7
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Sun Dec 12 16:42:37 2010 +0900

    Fixed gtk_cell_area_context_real_reset() to only notify properties if they change.

 gtk/gtkcellareacontext.c |   35 ++++++++++++++++++++++++++---------
 1 files changed, 26 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkcellareacontext.c b/gtk/gtkcellareacontext.c
index 164af47..087b590 100644
--- a/gtk/gtkcellareacontext.c
+++ b/gtk/gtkcellareacontext.c
@@ -284,18 +284,35 @@ gtk_cell_area_context_real_reset (GtkCellAreaContext *context)
 {
   GtkCellAreaContextPrivate *priv = context->priv;
   
-  priv->min_width    = -1;
-  priv->nat_width    = -1;
-  priv->min_height   = -1;
-  priv->nat_height   = -1;
+  g_object_freeze_notify (G_OBJECT (context));
+
+  if (priv->min_width != -1)
+    {
+      priv->min_width = -1;
+      g_object_notify (G_OBJECT (context), "minimum-width");
+    }
+
+  if (priv->nat_width != -1)
+    {
+      priv->nat_width = -1;
+      g_object_notify (G_OBJECT (context), "natural-width");
+    }
+
+  if (priv->min_height != -1)
+    {
+      priv->min_height = -1;
+      g_object_notify (G_OBJECT (context), "minimum-height");
+    }
+
+  if (priv->nat_height != -1)
+    {
+      priv->nat_height = -1;
+      g_object_notify (G_OBJECT (context), "natural-height");
+    }
+
   priv->alloc_width  = 0;
   priv->alloc_height = 0;
 
-  g_object_freeze_notify (G_OBJECT (context));
-  g_object_notify (G_OBJECT (context), "minimum-width");
-  g_object_notify (G_OBJECT (context), "natural-width");
-  g_object_notify (G_OBJECT (context), "minimum-height");
-  g_object_notify (G_OBJECT (context), "natural-height");
   g_object_thaw_notify (G_OBJECT (context));
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]