summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Sorokin <[email protected]>2017-03-27 12:07:48 +0300
committerAlexei Sorokin <[email protected]>2017-03-27 12:07:48 +0300
commitdedfcf46269792f1fa112d6236226f17d7d8050d (patch)
tree28cf70bbd3f1dd45f1345d7952f26d1109fd3ac1
parentf6e841f9161b6b943b987a8dd7c13ed16bca13a3 (diff)
downloadcaja-dedfcf46269792f1fa112d6236226f17d7d8050d.tar.bz2
caja-dedfcf46269792f1fa112d6236226f17d7d8050d.tar.xz
[GTK+2] eel: Revert to set_back_pixmap for directories too
Fixes #752
-rw-r--r--eel/eel-background.c28
-rw-r--r--libcaja-private/caja-icon-container.c26
2 files changed, 18 insertions, 36 deletions
diff --git a/eel/eel-background.c b/eel/eel-background.c
index 98b26176..ae95828a 100644
--- a/eel/eel-background.c
+++ b/eel/eel-background.c
@@ -675,32 +675,36 @@ eel_background_set_up_widget (EelBackground *self)
window = gtk_widget_get_window (widget);
}
+#if !GTK_CHECK_VERSION (3, 0, 0)
+ if (self->details->bg_surface != NULL)
+ {
+ gdk_window_set_back_pixmap (window,
+ self->details->bg_surface, FALSE);
+ }
+ else
+ {
+ GdkColor color = self->details->default_color;
+ make_color_inactive (self, &color);
+ gdk_window_set_background (window, &color);
+ }
+ gdk_window_invalidate_rect (window, NULL, TRUE);
+
+#endif
if (self->details->is_desktop)
{
-#if !GTK_CHECK_VERSION (3, 22, 0)
+#if GTK_CHECK_VERSION (3, 0, 0) && !GTK_CHECK_VERSION (3, 22, 0)
if (self->details->bg_surface != NULL)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_pattern_t *pattern =
cairo_pattern_create_for_surface (self->details->bg_surface);
gdk_window_set_background_pattern (window, pattern);
cairo_pattern_destroy (pattern);
-#else
- gdk_window_set_back_pixmap (window,
- self->details->bg_surface, FALSE);
-#endif
}
else
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA color = self->details->default_color;
make_color_inactive (self, &color);
gdk_window_set_background_rgba (window, &color);
-#else
- GdkColor color = self->details->default_color;
- make_color_inactive (self, &color);
- gdk_window_set_background (window, &color);
-#endif
}
gdk_window_invalidate_rect (window, NULL, TRUE);
#endif
diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c
index dfdca59f..1c61184d 100644
--- a/libcaja-private/caja-icon-container.c
+++ b/libcaja-private/caja-icon-container.c
@@ -4700,38 +4700,19 @@ size_allocate (GtkWidget *widget,
}
}
-static gboolean
#if GTK_CHECK_VERSION (3, 0, 0)
+static gboolean
draw (GtkWidget *widget, cairo_t *cr)
-#else
-expose_event (GtkWidget *widget, GdkEventExpose *event)
-#endif
{
if (!CAJA_ICON_CONTAINER (widget)->details->is_desktop)
{
-#if !GTK_CHECK_VERSION (3, 0, 0)
- cairo_t *cr = gdk_cairo_create (event->window);
-
- gdk_cairo_rectangle (cr, &event->area);
- cairo_clip (cr);
-
-#endif
eel_background_draw (widget, cr);
-#if !GTK_CHECK_VERSION (3, 0, 0)
-
- cairo_destroy (cr);
-#endif
}
-#if GTK_CHECK_VERSION (3, 0, 0)
return GTK_WIDGET_CLASS (caja_icon_container_parent_class)->draw (widget,
cr);
-#else
- return
- GTK_WIDGET_CLASS (caja_icon_container_parent_class)->expose_event (widget,
- event);
-#endif
}
+#endif
static void
realize (GtkWidget *widget)
@@ -6786,8 +6767,6 @@ caja_icon_container_class_init (CajaIconContainerClass *class)
widget_class->size_allocate = size_allocate;
#if GTK_CHECK_VERSION (3, 0, 0)
widget_class->draw = draw;
-#else
- widget_class->expose_event = expose_event;
#endif
widget_class->realize = realize;
widget_class->unrealize = unrealize;
@@ -6805,7 +6784,6 @@ caja_icon_container_class_init (CajaIconContainerClass *class)
widget_class->style_updated = style_updated;
#else
widget_class->style_set = style_set;
- widget_class->expose_event = expose_event;
#endif
widget_class->grab_notify = grab_notify_cb;