[polari] chatView: Guard calls to gtk_style_context_get_color()



commit a6d7dc2319f82d748a0744a1dfc5c984f23fda63
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jun 19 15:59:02 2015 +0200

    chatView: Guard calls to gtk_style_context_get_color()
    
    Commit fe51ac273c8 changed the fallback behavior when the looked up
    state mismatches the actual state; as a result, the lookup may now
    trigger the GtkStyleContext::changed signal - and as we happen to do
    the lookup from a ::changed handler, we set off infinite recursion
    with the expected fatal consequences.
    Prevent this by guarding the lookup with a save()/restore() pair.

 src/chatView.js |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index ba3e6b6..8abd4b5 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -189,8 +189,10 @@ const ChatView = new Lang.Class({
         let dimColor = context.get_color(Gtk.StateFlags.NORMAL);
         context.restore();
 
+        context.save();
         let linkColor = context.get_color(Gtk.StateFlags.LINK);
         this._activeNickColor = context.get_color(Gtk.StateFlags.LINK);
+        context.restore();
 
         let desaturatedNickColor = (this._activeNickColor.red +
                                     this._activeNickColor.blue +


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