[meld] diffgrid: Stop chaining up to avoid re-allocation loop (bgo#779883)



commit 72655fc347ec72114cca6b37e01a57d0870a761b
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun May 14 08:20:44 2017 +1000

    diffgrid: Stop chaining up to avoid re-allocation loop (bgo#779883)
    
    This commit is basically "I give up".
    
    Because of GTK+'s use of the private GtkCSSGadget class in a bunch
    of widgets, these widgets have become, as far as I can tell, effectively
    impossible to subclass. When we hit issues with logging complaining
    about missing allocation (despite no actual user-visible effects) the
    advice was to always chain up when doing allocation. While this silenced
    the warnings, it turns out that in some cases it leads to re-allocation
    loops that never resolve. In our case, this looks like
    DiffGrid.do_size_allocate() being called (from the main event loop)
    forever.
    
    I've spent way too long trying to bisect this, but what with behaviour
    changes and slight differences in the symptoms, I've run out of any
    motivation. As a result, I'm applying this crime of a patch that makes
    the problem go away and reverts to our previous working behaviour.

 meld/diffgrid.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/meld/diffgrid.py b/meld/diffgrid.py
index dd96b9c..c413eff 100644
--- a/meld/diffgrid.py
+++ b/meld/diffgrid.py
@@ -144,7 +144,11 @@ class DiffGrid(Gtk.Grid):
         return int(round(pos1)), int(round(pos2))
 
     def do_size_allocate(self, allocation):
-        Gtk.Grid.do_size_allocate(self, allocation)
+        # We should be chaining up here to:
+        #     Gtk.Grid.do_size_allocate(self, allocation)
+        # However, when we do this, we hit issues with doing multiple
+        # allocations in a single allocation cycle (see bgo#779883).
+
         self.set_allocation(allocation)
         wcols, hrows = self._get_min_sizes()
         yrows = [allocation.y,


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