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 738841 - Regression in GTK+ 3.12 in handling CSS-defined selected_bg_color
Regression in GTK+ 3.12 in handling CSS-defined selected_bg_color
Product: gtk+
Classification: Platform
Component: Class: GtkStyleContext
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Depends on:
Reported: 2014-10-20 07:10 UTC by Balint Reczey
Modified: 2016-01-10 19:44 UTC
See Also:
GNOME target: ---
GNOME version: 3.13/3.14

Description Balint Reczey 2014-10-20 07:10:30 UTC
Wireshark moved to setting selected text's background color via CSS
[1] when the method used in GTK+ 2.x stopped working based on the
suggestion at [2].

It works fine on wheezy (see first attached image) using GTK+ 3.6 but
stopped working on Jessie (see second attached image) with GTK+ 3.12.
I tested it using Homebrew and with GTK+ 3.14 this also fails and as I
remember GTK+ 3.10 worked OK.


The problem has been reported to Debian's BTS first, please see che screenshots there:

3.14.1 still has the problem.
Comment 1 Matthias Clasen 2014-12-05 02:02:49 UTC
That looks pretty random. Why is it redefining themed colors that are likely already defined by the theme, instead of just using the rgb values in the css directly ?
Comment 2 Benjamin Otte (Company) 2014-12-05 03:28:50 UTC
Named colors in GTK have historically been rather undefined and up to the theme to define. Whenever there are substantial changes to the theme (Adwaita itself has seen substantial rewrites over the course of GTK 3 and when switching themes nothing is guaranteed at all).
So if color names do work, it's usually more luck than anything else.

The suggested way is to use gtk_style_context_save(), gtk_style_context_set_state(), gtk_style_context_add_class() and gtk_render_background() or gtk_style_context_get_color() for rendering instead of relying on color names.

As a clunky backwards-compatibility mechanism, Adwaita supports some color names that we realized applications were using via so it might be possible as a short-term fix to fall back to those in Wireshark.

We might also want to extend those named colors with the names from your links, though I'll leave that to the themes people.
Comment 3 Matthias Clasen 2016-01-10 19:44:28 UTC
Lets not add more named colors