Closed Bug 1654323 Opened 4 years ago Closed 4 years ago

Wrong selection color when using the GTK backend

Categories

(Core :: Widget: Gtk, defect, P3)

78 Branch
defect

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: tintou, Assigned: emilio)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Steps to reproduce:

Select a text on any webpage

Actual results:

The text and background colors haven't changed

Expected results:

The text and background colors should be the selected text color

I think that I found the issue:
According to https://github.com/mozilla/gecko-dev/blob/master/widget/gtk/nsLookAndFeel.cpp#L1128 it seems that Firefox is using the color of the selected|active state of GtkTextView.text
According to the Gtk documentation ( https://developer.gnome.org/gtk3/stable/GtkTextView.html#id-1.3.11.8.12.3 ) the GtkTextView has a selection node which is the one providing the selection color

Issue reproducible with the latest elementary OS GTK Stylesheet https://github.com/elementary/stylesheet/

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

Is there any simple test case available?
Thanks.

Flags: needinfo?(corentin)
Priority: -- → P3

The colors that we use are these.

Ah, sorry, they were linked already above...

The attached patch should fix it, but if you can give a way to repro the issue on Fedora it'd be great, so that I can confirm it. Otherwise could you confirm that before I send it for review? :)

I'm unable to test it as it seems that running ./mach build on my system doesn't take the changes to the GTK backend into account. To test it, simply use the latest master of the elementary GTK theme ( https://github.com/elementary/stylesheet/ )

Flags: needinfo?(tintou)
Assignee: nobody → emilio
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ee33d63ab06a
Use GtkTextView.text.selection to get selection colors in GTK. r=stransky
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
Regressions: 1665317
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: