[gtksourceview/wip/improve-gutter-perfs: 1/2] gutter: allow queue_redraw() during drawing



commit 49ec8bf9936a64cbe3e1a68c12874bb4cbbd667e
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Sep 12 15:18:22 2014 +0200

    gutter: allow queue_redraw() during drawing
    
    It'll be needed for the lines renderer. I think it is safe to allow a
    queue_redraw() during drawing. Normally there won't be infinite loops.

 gtksourceview/gtksourcegutter.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
---
diff --git a/gtksourceview/gtksourcegutter.c b/gtksourceview/gtksourcegutter.c
index 978a5e0..a4988c3 100644
--- a/gtksourceview/gtksourcegutter.c
+++ b/gtksourceview/gtksourcegutter.c
@@ -83,8 +83,6 @@ struct _GtkSourceGutterPrivate
 
        gint xpad;
        gint ypad;
-
-       guint is_drawing : 1;
 };
 
 G_DEFINE_TYPE_WITH_PRIVATE (GtkSourceGutter, gtk_source_gutter, G_TYPE_OBJECT)
@@ -346,7 +344,7 @@ do_redraw (GtkSourceGutter *gutter)
        window = gtk_text_view_get_window (GTK_TEXT_VIEW (gutter->priv->view),
                                           gutter->priv->window_type);
 
-       if (window && !gutter->priv->is_drawing)
+       if (window != NULL)
        {
                gdk_window_invalidate_rect (window, NULL, FALSE);
        }
@@ -974,8 +972,6 @@ on_view_draw (GtkSourceView   *view,
                return FALSE;
        }
 
-       gutter->priv->is_drawing = TRUE;
-
        text_view = GTK_TEXT_VIEW (view);
        buffer = gtk_text_view_get_buffer (text_view);
 
@@ -1241,8 +1237,6 @@ on_view_draw (GtkSourceView   *view,
        g_array_free (heights, TRUE);
        g_array_free (sizes, TRUE);
 
-       gutter->priv->is_drawing = FALSE;
-
        gtk_style_context_restore (style_context);
 
        return FALSE;


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