[gtksourceview/gnome-3-18] StyleScheme: save/restore StyleContext when getting color



commit 4f27389680bea61af70ddf19183c68959feb04e5
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed Nov 25 15:25:22 2015 +0100

    StyleScheme: save/restore StyleContext when getting color

 gtksourceview/gtksourcestylescheme.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourcestylescheme.c b/gtksourceview/gtksourcestylescheme.c
index 7591797..08500a8 100644
--- a/gtksourceview/gtksourcestylescheme.c
+++ b/gtksourceview/gtksourcestylescheme.c
@@ -674,11 +674,16 @@ get_cursors_css_style (GtkSourceStyleScheme *scheme,
 
                context = gtk_widget_get_style_context (widget);
 
+               gtk_style_context_save (context);
+               gtk_style_context_set_state (context, GTK_STATE_FLAG_NORMAL);
+
                gtk_style_context_get (context,
-                                      GTK_STATE_FLAG_NORMAL,
+                                      gtk_style_context_get_state (context),
                                       "background-color", &rgba,
                                       NULL);
 
+               gtk_style_context_restore (context);
+
                /* shade the secondary cursor */
                secondary_color.red = rgba->red * 0.5;
                secondary_color.green = rgba->green * 0.5;


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