[snap] with CSD and Yaru, background color of the header bar is incorrect

Bug #1800260 reported by Jeff Vehrs on 2018-10-27
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
Medium
Unassigned

Bug Description

Description: Ubuntu 18.04.1 LTS
Release: 18.04

Channel: Stable
Version: 70.0.3538.67
Updated: 10/19/2018
License: Free
Developer: Canonical
Source: Snap Store
Installed Size: 148.2 MB

Settings -> Appearance: "Use system title bar and borders" was turned off. Close, minimize, maximize buttons became oval (more of stretched down) instead of circle. Turned back it on, buttons went back to normal shape (circle). It's a repeatable action.

Paul White (paulw2u) on 2018-11-10
summary: - close, minimize, maximize buttons look funny
+ [snap] close, minimize, maximize buttons look funny

Thanks for the report Jeff. I can reliably observe the problem in a bionic VM.
I also tested the snap in the candidate channel (based on core18), and there are also issues with the custom rendering of the window title bar and borders, although they are different (only the close button is visible, minimize and maximize can be hovered and clicked but they are not rendered properly).

Changed in chromium-browser (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
tags: added: snap

Updated the bug title because all chromium snaps are based off core18, and the symptoms are slightly different to what was initially reported.

summary: - [snap] close, minimize, maximize buttons look funny
+ [snap] with CSD, minimize and maximize buttons are invisible until
+ hovered
Olivier Tilloy (osomon) wrote :

Preliminary investigation: the code in chromium responsible for looking up the theme color for the header bar is there: https://cs.chromium.org/chromium/src/chrome/browser/ui/libgtkui/gtk_ui.cc?type=cs&l=864.

Outside of the snap confinement, the query for "#headerbar.header-bar.titlebar" returns the expected RGB value (for Yaru) of (43,43,41). But within the snap confinement the computed value is (242,242,242).

I suspect the version of Yaru that's in gtk-common-themes has something to do with this, but I need to write a minimal reproducer to verify that.

Olivier Tilloy (osomon) wrote :

I updated the title to reflect the fact that only Yaru (or communitheme on older releases) seems to be affected. All the other themes that I tested behave correctly.

summary: - [snap] with CSD, minimize and maximize buttons are invisible until
- hovered
+ [snap] with CSD and Yaru, background color of the header bar is
+ incorrect
Olivier Tilloy (osomon) wrote :

This is not a confinement problem, as the same happens when the snap is installed in devmode.

Something must be missing, either in the gtk-common-themes snap or in the snapcraft-desktop-helpers desktop-launch script, but I don't know what yet.

I straced the execution of the snap, and it locates and opens the expected css file (~/snap/chromium/current/.local/share/themes/Yaru/gtk-3.20/gtk.css), so it's puzzling that it doesn't extract the right background color value for the headerbar.

Olivier Tilloy (osomon) wrote :

I modified Yaru in the gtk-common-themes snap with different, garish colors for the focused and unfocused headerbar. In other snaps such as gnome-calculator these new colors were picked up as expected. In chromium, only the unfocused color was applied, the focused one remained (242,242,242).

Olivier Tilloy (osomon) wrote :

I tested a few more things, unsuccessfully:

 - I modified the Yaru theme css in gtk-common-themes to remove the ".titlebar:not(headerbar)," selector, keeping only the "headerbar" selector for header bars, but no difference

 - I modified the custom selector in gtk_ui.cc to be just "#headerbar" instead of "#headerbar.header-bar.titlebar", but no difference

 - I instrumented AppendCssNodeToStyleContext() in gtk_util.cc to print out the actual selectors being queried at the end of the function, just before the return statement, and they looked correct ("window⤶headerbar" and "window⤶headerbar:backdrop")

Olivier Tilloy (osomon) wrote :

I tested in an XFCE/XUbuntu session, and the focused headerbar color was correct, so there's something specific to the Ubuntu/GNOME session.

Olivier Tilloy (osomon) wrote :

This doesn't appear to be chromium-specific, nor Yaru-specific. I initially thought that only Yaru was exhibiting an incorrect background color for the focused headerbar, but I am now seeing an incorrect color with the gnome-calculator snap when using Adwaita.

Olivier Tilloy (osomon) wrote :

I'm attaching a screenshot demonstrating my claim above, showing gnome-calculator as a snap on the left, and from the deb on the right. This is in a clean and up-to-date disco VM, with Adwaita as the default theme. Colours clearly aren't right with the snap.

Olivier Tilloy (osomon) wrote :
Olivier Tilloy (osomon) wrote :

(and both are focused, of course)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers