[polari/gnome-3-16] chatView: Guard calls to gtk_style_context_get_color()



commit 2b22cfc5c5c60cb7c98d91839d86147df39dea5c
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 04e1a07..f88a2a1 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -187,7 +187,9 @@ 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);
+        context.restore();
 
         let buffer = this._view.get_buffer();
         let tagTable = buffer.get_tag_table();


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