[eog: 2/3] Replace gdk_window_get_background_pattern by getting background-color property
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog: 2/3] Replace gdk_window_get_background_pattern by getting background-color property
- Date: Sat, 14 Aug 2021 16:19:50 +0000 (UTC)
commit d56bf8c3d3d31cc8eb0f2530fe9d0d4a1023b8c8
Author: Krifa75 <yahiaoui fakhri gmail com>
Date: Mon May 10 21:02:44 2021 +0200
Replace gdk_window_get_background_pattern by getting background-color property
src/eog-scroll-view.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/eog-scroll-view.c b/src/eog-scroll-view.c
index a1dc6432..a79712b2 100644
--- a/src/eog-scroll-view.c
+++ b/src/eog-scroll-view.c
@@ -1343,8 +1343,19 @@ display_draw (GtkWidget *widget, cairo_t *cr, gpointer data)
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)));
+ else {
+ GtkStyleContext *context;
+ GdkRGBA *pattern_rgba;
+ GtkStateFlags state;
+
+ context = gtk_widget_get_style_context (priv->display);
+ state = gtk_style_context_get_state (context);
+
+ gtk_style_context_get (context, state, GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &pattern_rgba,
NULL);
+ gdk_cairo_set_source_rgba (cr, pattern_rgba);
+
+ gdk_rgba_free (pattern_rgba);
+ }
cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
cairo_fill (cr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]