[gnome-boxes] Fix inifinite loop in MenuBox



commit 9fe1894abd92661b56128dad9473d02475bea9f5
Author: Alexander Larsson <alexl redhat com>
Date:   Tue May 22 12:27:24 2012 +0200

    Fix inifinite loop in MenuBox
    
    We need to save/restore the StyleContext when we change it during
    drawing, otherwise we end up causing a style change that will forever
    loop in the restyle/redraw idles.

 src/menu-box.vala |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/menu-box.vala b/src/menu-box.vala
index e78f7ac..51e4920 100644
--- a/src/menu-box.vala
+++ b/src/menu-box.vala
@@ -107,10 +107,12 @@ private class Boxes.MenuBox: Gtk.Box {
                     junction |= Gtk.JunctionSides.LEFT;
             }
 
+            ctxt.save ();
             ctxt.set_state (child.get_state_flags ());
             ctxt.set_junction_sides (junction);
             ctxt.render_background (cr, child_allocation.x, child_allocation.y,
                                     child_allocation.width, child_allocation.height);
+            ctxt.restore ();
         }
 
         return base.draw (cr);



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