diff options
author | Carlos Soriano <csoriano@gnome.org> | 2016-02-15 11:06:15 +0100 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2016-02-15 11:38:43 +0100 |
commit | ab61aa46d8fa77ad1e3d8beb6269d45a927329e7 (patch) | |
tree | d60725b67935f7c969b99ef1de44888cc5668eba /eel | |
parent | 16c4057957723d9bb8e8ae8a821edf929cdbfa03 (diff) | |
download | nautilus-ab61aa46d8fa77ad1e3d8beb6269d45a927329e7.tar.gz |
eel-canvas: remove background draw handling
This seems no longer necessary. It looks like it was done to avoid
flashing when redrawing, but probably this was fixed sometime in the
past, so a transparent background in a widget doesn't flash anymore.
https://bugzilla.gnome.org/show_bug.cgi?id=761965
Diffstat (limited to 'eel')
-rw-r--r-- | eel/eel-canvas.c | 48 | ||||
-rw-r--r-- | eel/eel-canvas.h | 5 |
2 files changed, 0 insertions, 53 deletions
diff --git a/eel/eel-canvas.c b/eel/eel-canvas.c index 0040a430b..cbc4372fd 100644 --- a/eel/eel-canvas.c +++ b/eel/eel-canvas.c @@ -1728,11 +1728,6 @@ group_remove (EelCanvasGroup *group, EelCanvasItem *item) /*** EelCanvas ***/ -enum { - DRAW_BACKGROUND, - LAST_SIGNAL -}; - static void eel_canvas_class_init (EelCanvasClass *klass); static void eel_canvas_init (EelCanvas *canvas); static void eel_canvas_destroy (GtkWidget *object); @@ -1757,13 +1752,8 @@ static gint eel_canvas_focus_in (GtkWidget *widget, static gint eel_canvas_focus_out (GtkWidget *widget, GdkEventFocus *event); static void eel_canvas_request_update_real (EelCanvas *canvas); -static void eel_canvas_draw_background (EelCanvas *canvas, - cairo_t *cr); - static GtkLayoutClass *canvas_parent_class; -static guint canvas_signals[LAST_SIGNAL]; - /** * eel_canvas_get_type: * @@ -1967,19 +1957,8 @@ eel_canvas_class_init (EelCanvasClass *klass) widget_class->focus_in_event = eel_canvas_focus_in; widget_class->focus_out_event = eel_canvas_focus_out; - klass->draw_background = eel_canvas_draw_background; klass->request_update = eel_canvas_request_update_real; - canvas_signals[DRAW_BACKGROUND] = - g_signal_new ("draw-background", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EelCanvasClass, draw_background), - NULL, NULL, - g_cclosure_marshal_VOID__BOXED, - G_TYPE_NONE, 1, - CAIRO_GOBJECT_TYPE_CONTEXT); - gtk_widget_class_set_accessible_type (widget_class, eel_canvas_accessible_get_type ()); } @@ -2868,12 +2847,6 @@ eel_canvas_draw (GtkWidget *widget, cairo_t *cr) canvas->need_update = FALSE; } - /* Hmmm. Would like to queue antiexposes if the update marked - anything that is gonna get redrawn as invalid */ - - g_signal_emit (G_OBJECT (canvas), canvas_signals[DRAW_BACKGROUND], 0, - cr); - if (canvas->root->flags & EEL_CANVAS_ITEM_MAPPED) EEL_CANVAS_ITEM_GET_CLASS (canvas->root)->draw (canvas->root, cr, region); @@ -2888,27 +2861,6 @@ eel_canvas_draw (GtkWidget *widget, cairo_t *cr) } static void -eel_canvas_draw_background (EelCanvas *canvas, - cairo_t *cr) -{ - cairo_rectangle_int_t rect; - GtkStyleContext *style_context; - GdkRGBA color; - - if (!gdk_cairo_get_clip_rectangle (cr, &rect)) - return; - - cairo_save (cr); - /* By default, we use the style background. */ - style_context = gtk_widget_get_style_context (GTK_WIDGET (canvas)); - gtk_style_context_get_background_color (style_context, GTK_STATE_FLAG_NORMAL, &color); - gdk_cairo_set_source_rgba (cr, &color); - gdk_cairo_rectangle (cr, &rect); - cairo_fill (cr); - cairo_restore (cr); -} - -static void do_update (EelCanvas *canvas) { /* Cause the update if necessary */ diff --git a/eel/eel-canvas.h b/eel/eel-canvas.h index 28d5d0274..56db0b775 100644 --- a/eel/eel-canvas.h +++ b/eel/eel-canvas.h @@ -423,11 +423,6 @@ struct _EelCanvas { struct _EelCanvasClass { GtkLayoutClass parent_class; - /* Draw the background for the area given. - */ - void (* draw_background) (EelCanvas *canvas, - cairo_t *cr); - /* Private Virtual methods for groping the canvas inside bonobo */ void (* request_update) (EelCanvas *canvas); |