[gtksourceview/gnome-3-10] StyleScheme: invalidate the style context



commit 09c08d06413649e00284893409bbeb3c6f3b7c68
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Sep 22 21:20:26 2013 +0200

    StyleScheme: invalidate the style context
    
    Invalidate the GtkStyleContext when a GtkCssProvider is added or
    removed. It is needed because the new style information is requested
    immediately. See https://bugzilla.gnome.org/show_bug.cgi?id=708583

 gtksourceview/gtksourcestylescheme.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtksourceview/gtksourcestylescheme.c b/gtksourceview/gtksourcestylescheme.c
index db41332..c0f652b 100644
--- a/gtksourceview/gtksourcestylescheme.c
+++ b/gtksourceview/gtksourcestylescheme.c
@@ -733,6 +733,8 @@ _gtk_source_style_scheme_apply (GtkSourceStyleScheme *scheme,
                                        GTK_STYLE_PROVIDER (scheme->priv->css),
                                        GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
 
+       gtk_style_context_invalidate (context);
+
        style = gtk_source_style_scheme_get_style (scheme, STYLE_LINE_NUMBERS);
        set_line_numbers_style (widget, style);
 
@@ -762,6 +764,7 @@ _gtk_source_style_scheme_unapply (GtkSourceStyleScheme *scheme,
        context = gtk_widget_get_style_context (GTK_WIDGET (widget));
        gtk_style_context_remove_provider (context,
                                           GTK_STYLE_PROVIDER (scheme->priv->css));
+       gtk_style_context_invalidate (context);
        set_line_numbers_style (widget, NULL);
        update_cursor_colors (widget, NULL, NULL);
 }


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