GNOME Bugzilla – Bug 783120
gd-nav-bar: Don't use gtk_style_context_set_background
Last modified: 2017-05-26 10:24:58 UTC
I couldn't figure out why we had introduced gtk_style_context_set_background in commit 74dd32170d3aca20bbce1282bd24193807306603. I understood why GtkDrawingArea and others need to use it for compatibility, but GdNavBar uses gtk_render_background and chains up in its draw method. At least it doesn't seem necessary today, and causes this deprecation warning: lib/gd-nav-bar.c: In function ‘gd_nav_bar_realize’: lib/gd-nav-bar.c:739:9: warning: ‘gtk_style_context_set_background’ is deprecated: Use 'gtk_render_background' instead [-Wdeprecated-declarations] gtk_style_context_set_background (gtk_widget_get_style_context (widget), window); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/gtk-3.0/gtk/gtkicontheme.h:27:0, from /usr/include/gtk-3.0/gtk/gtk.h:123, from lib/gd-nav-bar.h:23, from lib/gd-nav-bar.c:24: /usr/include/gtk-3.0/gtk/gtkstylecontext.h:1232:6: note: declared here void gtk_style_context_set_background (GtkStyleContext *context, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Created attachment 352632 [details] [review] nav-bar: Don't use gtk_style_context_set_background
Review of attachment 352632 [details] [review]: Sure, looks good. There should be no reason to call that function these days.
Comment on attachment 352632 [details] [review] nav-bar: Don't use gtk_style_context_set_background Thanks, Cosimo!