summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/eom-scroll-view.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/eom-scroll-view.c b/src/eom-scroll-view.c
index adb6d26..6f84286 100644
--- a/src/eom-scroll-view.c
+++ b/src/eom-scroll-view.c
@@ -1197,6 +1197,7 @@ eom_scroll_view_focus_out_event (GtkWidget *widget,
static gboolean
display_draw (GtkWidget *widget, cairo_t *cr, gpointer data)
{
+ const GdkRGBA *background_color = NULL;
EomScrollView *view;
EomScrollViewPrivate *priv;
GtkAllocation allocation;
@@ -1233,10 +1234,22 @@ display_draw (GtkWidget *widget, cairo_t *cr, gpointer data)
priv->zoom, xofs, yofs, scaled_width, scaled_height);
/* Paint the background */
- cairo_set_source (cr, gdk_window_get_background_pattern (gtk_widget_get_window (priv->display)));
cairo_rectangle (cr, 0, 0, allocation.width, allocation.height);
- cairo_rectangle (cr, MAX (0, xofs), MAX (0, yofs),
- scaled_width, scaled_height);
+ if (priv->transp_style != EOM_TRANSP_BACKGROUND)
+ cairo_rectangle (cr, MAX (0, xofs), MAX (0, yofs),
+ scaled_width, scaled_height);
+ if (priv->override_bg_color != NULL)
+ background_color = priv->override_bg_color;
+ else if (priv->use_bg_color)
+ background_color = priv->background_color;
+ if (background_color != NULL)
+ cairo_set_source_rgba (cr,
+ background_color->red,
+ background_color->green,
+ background_color->blue,
+ background_color->alpha);
+ else
+ cairo_set_source (cr, gdk_window_get_background_pattern (gtk_widget_get_window (priv->display)));
cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
cairo_fill (cr);
@@ -2202,16 +2215,8 @@ _eom_replace_gdk_rgba (GdkRGBA **dest, const GdkRGBA *src)
static void
_eom_scroll_view_update_bg_color (EomScrollView *view)
{
- const GdkRGBA *selected;
EomScrollViewPrivate *priv = view->priv;
- if (!priv->use_bg_color)
- selected = NULL;
- else if (priv->override_bg_color)
- selected = priv->override_bg_color;
- else
- selected = priv->background_color;
-
if (priv->transp_style == EOM_TRANSP_BACKGROUND
&& priv->background_surface != NULL) {
/* Delete the SVG background to have it recreated with
@@ -2220,10 +2225,7 @@ _eom_scroll_view_update_bg_color (EomScrollView *view)
priv->background_surface = NULL;
}
- /*gtk_widget_modify_bg (GTK_WIDGET (priv->display),
- GTK_STATE_NORMAL,
- selected);*/
- gtk_widget_override_background_color(GTK_WIDGET (priv->display), GTK_STATE_FLAG_NORMAL, selected);
+ gtk_widget_queue_draw (priv->display);
}
void