summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2016-02-15 11:06:15 +0100
committerCarlos Soriano <csoriano@gnome.org>2016-02-15 11:38:43 +0100
commitab61aa46d8fa77ad1e3d8beb6269d45a927329e7 (patch)
treed60725b67935f7c969b99ef1de44888cc5668eba
parent16c4057957723d9bb8e8ae8a821edf929cdbfa03 (diff)
downloadnautilus-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
-rw-r--r--eel/eel-canvas.c48
-rw-r--r--eel/eel-canvas.h5
-rw-r--r--libnautilus-private/nautilus-canvas-container.c13
3 files changed, 1 insertions, 65 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);
diff --git a/libnautilus-private/nautilus-canvas-container.c b/libnautilus-private/nautilus-canvas-container.c
index e3d0bd79a..294773056 100644
--- a/libnautilus-private/nautilus-canvas-container.c
+++ b/libnautilus-private/nautilus-canvas-container.c
@@ -4647,20 +4647,13 @@ popup_menu (GtkWidget *widget)
}
static void
-draw_canvas_background (EelCanvas *icon,
- cairo_t *cr)
-{
- /* Don't chain up to the parent to avoid clearing and redrawing */
-}
-
-static void
grab_notify_cb (GtkWidget *widget,
gboolean was_grabbed)
{
NautilusCanvasContainer *container;
container = NAUTILUS_CANVAS_CONTAINER (widget);
-
+
if (container->details->rubberband_info.active &&
!was_grabbed) {
/* we got a (un)grab-notify during rubberband.
@@ -4718,7 +4711,6 @@ static void
nautilus_canvas_container_class_init (NautilusCanvasContainerClass *class)
{
GtkWidgetClass *widget_class;
- EelCanvasClass *canvas_class;
G_OBJECT_CLASS (class)->constructor = nautilus_canvas_container_constructor;
G_OBJECT_CLASS (class)->finalize = finalize;
@@ -5075,9 +5067,6 @@ nautilus_canvas_container_class_init (NautilusCanvasContainerClass *class)
widget_class->style_updated = style_updated;
widget_class->grab_notify = grab_notify_cb;
- canvas_class = EEL_CANVAS_CLASS (class);
- canvas_class->draw_background = draw_canvas_background;
-
gtk_widget_class_set_accessible_type (widget_class, nautilus_canvas_container_accessible_get_type ());
gtk_widget_class_install_style_property (widget_class,