From 126358218ea22bc9fff02953db1e72bf96c9f184 Mon Sep 17 00:00:00 2001 From: Livanh Date: Mon, 15 Mar 2021 16:13:23 +0100 Subject: [PATCH 1/3] Fix background color with GTK3 --- src/gtk/exo/exo-icon-view.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gtk/exo/exo-icon-view.c b/src/gtk/exo/exo-icon-view.c index 3ce98099..62229e25 100644 --- a/src/gtk/exo/exo-icon-view.c +++ b/src/gtk/exo/exo-icon-view.c @@ -1878,6 +1878,16 @@ exo_icon_view_expose_event (GtkWidget *widget, if (!gtk_cairo_should_draw_window (cr, priv->bin_window)) return FALSE; + + /* draw a background according to the css theme */ + style = gtk_widget_get_style_context (widget); + gtk_style_context_save (style); + gtk_style_context_add_class (style, GTK_STYLE_CLASS_VIEW); + gtk_render_background (style, cr, + 0, 0, + gtk_widget_get_allocated_width (widget), + gtk_widget_get_allocated_height (widget)); + gtk_style_context_restore (style); #endif /* don't handle expose if the layout isn't done yet; the layout From 313bf9ee0a8bc318a50e17d22b7d963c29f51d0c Mon Sep 17 00:00:00 2001 From: Livanh Date: Tue, 16 Mar 2021 15:50:55 +0100 Subject: [PATCH 2/3] Remove unneeded call to gtk_widget_get_style_context() --- src/gtk/exo/exo-icon-view.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gtk/exo/exo-icon-view.c b/src/gtk/exo/exo-icon-view.c index 62229e25..4eb13de4 100644 --- a/src/gtk/exo/exo-icon-view.c +++ b/src/gtk/exo/exo-icon-view.c @@ -1989,9 +1989,7 @@ exo_icon_view_expose_event (GtkWidget *widget, } if (G_UNLIKELY (dest_item != NULL || priv->doing_rubberband)) -#if GTK_CHECK_VERSION(3, 0, 0) - style = gtk_widget_get_style_context (widget); -#else +#if !GTK_CHECK_VERSION(3, 0, 0) style = gtk_widget_get_style (widget); #endif From 75d3986f8a0de55d7cd7235eb1f03e79bbe6e08a Mon Sep 17 00:00:00 2001 From: Livanh Date: Tue, 16 Mar 2021 17:36:02 +0100 Subject: [PATCH 3/3] Fix possible "if" condition with empty body --- src/gtk/exo/exo-icon-view.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gtk/exo/exo-icon-view.c b/src/gtk/exo/exo-icon-view.c index 4eb13de4..893576cb 100644 --- a/src/gtk/exo/exo-icon-view.c +++ b/src/gtk/exo/exo-icon-view.c @@ -1988,8 +1988,8 @@ exo_icon_view_expose_event (GtkWidget *widget, #endif } - if (G_UNLIKELY (dest_item != NULL || priv->doing_rubberband)) #if !GTK_CHECK_VERSION(3, 0, 0) + if (G_UNLIKELY (dest_item != NULL || priv->doing_rubberband)) style = gtk_widget_get_style (widget); #endif