[hyena/gtk3] ListView: fix rendering glitch when child_size changes (bgo#709523)



commit 072c1ad905667a08d76d2f84930bc4ba29846aa4
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Sun Oct 6 20:10:12 2013 +0200

    ListView: fix rendering glitch when child_size changes (bgo#709523)
    
    On using the ListView in non-ViewLayout mode (the deprecated way to use
    this widget), there was a rendering glitch that was making gtk+ not
    refresh its drawing when child size changed (i.e.: when new elements
    were added on the model).
    
    The way to fix it is calling QueueResize() when the measuring of the
    child size happens, and this size ends up being different than the
    previous time (if we did in all cases, the performance would be degraded
    without need).

 .../Hyena.Data.Gui/ListView/ListView_Rendering.cs  |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs 
b/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
index b10608e..e15f813 100644
--- a/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
+++ b/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
@@ -128,7 +128,9 @@ namespace Hyena.Data.Gui
 
             // FIXME: legacy list foo
             if (ViewLayout == null) {
-                OnMeasure ();
+                if (OnMeasure ()) {
+                    QueueResize ();
+                }
             }
             // treview style
             StyleContext.Save ();
@@ -635,17 +637,21 @@ namespace Hyena.Data.Gui
                 : new Gdk.Size (0, ColumnCellText.ComputeRowHeight (this));
         }
 
-        private void OnMeasure ()
+        private bool OnMeasure ()
         {
             if (!measure_pending) {
-                return;
+                return false;
             }
 
             measure_pending = false;
 
             header_height = 0;
+
+            var old_child_size = child_size;
             child_size = OnMeasureChild ();
             UpdateAdjustments ();
+
+            return old_child_size != child_size;
         }
 
 #endregion


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