summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Pacaud <[email protected]>2015-08-26 02:11:28 +0200
committerraveit65 <[email protected]>2017-04-26 23:04:42 +0200
commitcb7f2fea8bd5ce5a71f8cbb5ab228f67c57c1596 (patch)
tree5a586d75b5e93067d1fd450e7676f2d9fc95c9d2
parente1ff4da51bba3ba2f5ccb51782492bf67ee3d005 (diff)
downloadeom-cb7f2fea8bd5ce5a71f8cbb5ab228f67c57c1596.tar.bz2
eom-cb7f2fea8bd5ce5a71f8cbb5ab228f67c57c1596.tar.xz
EomScrollView: fix override_background deprecated call
Do the necessary background drawing in draw callback. taken from: https://git.gnome.org/browse/eog/commit/?id=aea6404
-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