After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 783120 - gd-nav-bar: Don't use gtk_style_context_set_background
gd-nav-bar: Don't use gtk_style_context_set_background
Status: RESOLVED FIXED
Product: gnome-documents
Classification: Core
Component: general
3.25.x
Other All
: Normal normal
: ---
Assigned To: GNOME documents maintainer(s)
GNOME documents maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-05-26 09:18 UTC by Debarshi Ray
Modified: 2017-05-26 10:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
nav-bar: Don't use gtk_style_context_set_background (840 bytes, patch)
2017-05-26 09:20 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2017-05-26 09:18:38 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,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comment 1 Debarshi Ray 2017-05-26 09:20:23 UTC
Created attachment 352632 [details] [review]
nav-bar: Don't use gtk_style_context_set_background
Comment 2 Cosimo Cecchi 2017-05-26 10:11:19 UTC
Review of attachment 352632 [details] [review]:

Sure, looks good. There should be no reason to call that function these days.
Comment 3 Debarshi Ray 2017-05-26 10:24:31 UTC
Comment on attachment 352632 [details] [review]
nav-bar: Don't use gtk_style_context_set_background

Thanks, Cosimo!