Allow safe override of GDM3 theme

Bug #1715722 reported by Jeremy Soller on 2017-09-07
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GNOME Shell
Won't Fix
Medium
gnome-shell (Ubuntu)
Undecided
Jeremy Soller

Bug Description

Currently, in artful, GDM3's theme is hardcoded to be /usr/share/gnome-shell/theme/ubuntu.css

In the Ubuntu default session, this is the same CSS file as the gnome-shell mode in /usr/share/gnome-shell/modes/ubuntu.json

However, in other flavors, it makes sense to install another mode json and theme css file with a clear name. Take, for instance, pop-session, that installs /usr/share/gnome-shell/theme/pop.css and /usr/share/gnome-shell/modes/pop.json

In order to supply a custom GDM3 theme, which is currently hardcoded, the ubuntu.css file must be replaced with this pop.css file. This breaks ubuntu-session, causing it to have a different shell theme than expected.

What would be desirable is for the GDM3 CSS file to be hardcoded to gdm.css, which would be a symlink to the correct stylesheet for the flavor. This would allow multiple GNOME Shell sessions to be installed at the same time.

Changed in gnome-shell (Ubuntu):
assignee: nobody → Didier Roche (didrocks)
tags: added: gnome-17.10
Didier Roche (didrocks) wrote :

Unassigning for now as I don't know if I'll have time to get that done for 17.10.

However, I'll take any good patch from system76 implementing that feature (even better, I really think it should be pushed upstream). The best implementation IMHO is to not hardcode any css files with alternatives, but rather a settings for the gdm user pointing to the system-wide css file to load. Then, distros and OEM can use classic gsettings override to tweak it.

Changed in gnome-shell (Ubuntu):
assignee: Didier Roche (didrocks) → nobody
Jeremy Soller (jackpot51) wrote :

didrocks, I am going to do what I described above as it is a clean and quick method to having both of our systems ready for a 17.10 Beta release.

Is that ok?

Changed in gnome-shell (Ubuntu):
assignee: nobody → Jeremy Soller (jackpot51)
Jeremy Soller (jackpot51) wrote :

It is critical to our Beta release that we have a reliable method of overriding the GDM theme, so the alternatives method seems to be the best way to go. We can talk about further improvement and upstreaming after 17.10

Didier Roche (didrocks) wrote :

Quoting from #ubuntu-devel on IRC:

jackpot51 | didrocks: I am going to work on https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1715722 with the method I described first, having alternatives for a gdm.css file that is the stylesheet of GDM
jackpot51 | It is critical to our Beta release that we have a reliable method of overriding the GDM theme, so the alternatives method seems to be the best way to go. We can talk about further improvement and upstreaming after 17.10
jackpot51: I think it will need a FFe though
jackpot51 | In my mind, it isn't a feature
jackpot51 | It is a bug fix for a bug affecting flavors of Ubuntu using GNOME
didrocks | jackpot51: you meant "deratives" rather than flavors? I don't know of any existing 17.10 flavors using gdm?
jackpot51 | Yes, that is what I mean - derivatives
jackpot51 | If this becomes too complicated, we would have to fork the gnome-shell package to accomplish what we need to in Pop before 17.10
jackpot51 | So I would like to do this as simply and smartly as possible
didrocks | jackpot51: I guess you just need to talk to the release team telling us you want to do a temporary override until we get a better upstreamable solution and see if they consider it's a FF breakage or not
Laney | where does this pop.css come from?
jackpot51 | Ok, that sounds good to me
Laney | I think it'd be easier for you to dpkg-divert the ubuntu one away if this is a temporary solution for one derivative only

Jeremy Soller (jackpot51) wrote :

didrocks, here is a debdiff for implementing the alternatives method. It did not require much code.

Please let me know what you think!

Didier Roche (didrocks) wrote :

As told on IRC, I doubt this patch was tested. There is no reference of ubuntu.css in the postinst, and so, the alternatives is basically referencing itself.

In general, I'm really not a fan of that approach as told many times and would prefer an upstreamable solution. However, if anyone else wants to sponsor it, (after testing it) feel free.

Jeremy Soller (jackpot51) wrote :

Here is a new patch fixing the alternatives path. I am waiting on a launchpad build to test this fully:

https://launchpad.net/~system76/+archive/ubuntu/pop-staging/+build/13352379

Jeremy Soller (jackpot51) wrote :

didrocks, I will also work on an upstreamable solution, but I am not very satisfied with your unwillingness to see things from my perspective. You have essentially broken GDM3 for all Ubuntu derivatives, forcing your theme upon them, and then having no desire to work on any solution to remove this hard-coded theming

Jeremy Soller (jackpot51) wrote :

What is even worse, is that most of these changes that hard-code Ubuntu's theme happened on the edge of the Feature Freeze period, meaning any attempts to revert them or improve them are impaired by bureaucracy.

Please try to see why this is a problem, and learn from this in the future.

Jeremy Soller (jackpot51) wrote :

10:57 Laney hmm, I guess actually we could use this in Ubuntu to let people use the default gdm theme
11:00 Laney maybe not, that's the built in one isn't it?
11:00 Laney jackpot51: please attach it, I think it's worth considering

Didier Roche (didrocks) wrote :

Jeremy, you seem quite not listening to the advice we are giving to you, which is a maintainable solution to us. We told you multiple times we were happy to integrate what we think is a good solution from our perspective but you are not listening to those and seem like forcing your patch on us. This isn't how cooperation works.
In addition, your unwillingness to even start discussing/thinking about an upstream solution which isn't much more work than the override makes me fear that we'll keep that specific patch for one derative forever.
Also, you will understand that proposing a patch obviously broken, and such without testing it first doesn't really give confidence you will follow on a better solution rather that quick hack.

Alternatives aren't something which is good to take at that time of the release. I wanted a second option and Laney seemed to agree with me as we discussed on IRC.

As solutions:
* Laney suggested that if that's really a temporary solution (as you might agree to work on a more long term solution), dpkg-divert is a better idea. I'm happy to ease that for you so that people can still select the ubuntu session by symlink gdm3.css to ubuntu.css in our gnome-shell package. You can then dpkg-divert it and install your own gdm3.css from your theme package (is your package in ubuntu itself btw?). How does that sound? That way, you will get in the same state than the one before we changed gnome-shell.css by gdm3.css.
* The other solution, which is the more long term approach is to change for a gsettings key to select the theme.

Jeremy Soller (jackpot51) wrote :
Download full text (6.6 KiB)

11:01 Laney goodnight!
11:01 jackpot51 Ok, good night Laney
11:12 didrocks jackpot51: mind toning a little bit done please?
11:12 didrocks jackpot51: you are quite offensive in that bug report
11
:13 didrocks and proposing a patch that you even didn't test it doesn't really pledge your saying
11:14 jackpot51 I know I screwed up, and I am sorry. But I don't want to have our amount of maintenance increased significantly because of a hardcoded GDM theme. For the short term, I can override the gnome-shell package, but it is not good for release
11:14 didrocks jackpot51: does it justify this tone?
11:14 jackpot51 Building on gnome-shell on a new Artful installation is breaking, so I have to wait for the launchpad build to test changes.
11:15 jackpot51 No, it does not. I apologize for being offensive
11:15 didrocks ok, better ground (not really fancy having this kind of discussion on Friday at 7:15PM)
11:15 didrocks so, if I have the certainty you will work on a longer term solution, alternatives is ok
11:16 didrocks (as the other solution I gave)
11:16 didrocks I just don't want that we keep this for the LTS
11:17 didrocks does it make sense? If so, please test the patch (especially lock screen-wise, that's the part I'm unsure if you install 2 sessions with different lock screen theme, which one will be picked)
11:17 didrocks and if you tell me it's good, I can sponsor it on Monday
11:17 didrocks (after a final round of testing ofc)
11:18 jackpot51 What happened was that user-theme stopped working the day of feature freeze for us, leading to a cascade of theming changes we had to do. This culminated in theming GDM by replacing the ubuntu.css file, which broke my ability to use ubuntu-session. I like to see all three sessions (Ubuntu, Pop, and GNOME) for testing, so I only wanted a way to keep them all installed while having the GDM theme we had designed. That is all. We are in a scramble to get things fixed in a sane way, allowing us to release an ISO with our own theming. I am very sorry for out of line, I have misinterpreted messages from others and gone overboard.
11:18 didrocks but again, I don't want to carry the patch post-17.10. I think there is a very good opportunity for cooperating inside GNOME to have those easily themeable (Shell, GDM)
11:18 didrocks jackpot51: maybe your company could have talk or even help us within ubuntu itself to get things prepared
11:19 didrocks and we could have cooperated, things were discussed :)
11:20 jackpot51 I agree. I am here, always, with an IRC bouncer. I have been following the ubuntu-devel mailing list, which is where I first saw the gnome-shell changes. Other members of our community are present here.
11:21 didrocks come participate and ask during our meeting on #ubuntu-desktop, and work within ubuntu rather than a derivative, that will help your case being taken into account :)
11:21 jackpot51 I also want to have a good way for all GDM instances on all distributions to have the GDM look and feel configured
11:22 didrocks jackpot51: so, on that one, do we agree with the timeline? You test the patch (especially lock-screen wise), if all +1 (tell it on the bug report), I will sponsor this on Monday, an...

Read more...

Jeremy Soller (jackpot51) wrote :

The attachment "ubuntu_gdm_alternatives.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Jeremy Soller (jackpot51) wrote :

The build finished, and I installed Ubuntu, Pop, and GNOME sessions side-by-side. All three worked, and the GDM theme changed based on the alternative selected. I believe the second patch version works as expected.

Changed in gnome-shell:
importance: Unknown → Medium
status: Unknown → Won't Fix
Didier Roche (didrocks) wrote :

Thanks for reporting the bug upstream! I tried to add some more context to the upstream bug report from our vendor perspective.

The fix looks good, thanks! I'm currently testing it more. Also, I'm adding gnome-session to it: we can provide the same experience for people wanting to go really full GNOME and installing gnome-session. The priority though is lower than ubuntu's default, ofc.

I'll give it a little bit more test (I just modified slightly your description) and will sponsor it, thanks again!

Changed in gnome-shell (Ubuntu):
status: New → In Progress
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-shell - 3.25.91-0ubuntu4

---------------
gnome-shell (3.25.91-0ubuntu4) artful; urgency=medium

  [ Jeremy Soller ]
  * Change path of gdm3 stylesheet (LP: #1715722)
  * Add alternatives for gdm3 stylesheet, setting ubuntu.css as the default

  [ Didier Roche ]
  * debian/gnome-shell-common.install:
    Install upstream theme for gdm if vanilla gnome theme is selected.

 -- Jeremy Soller <email address hidden> Fri, 08 Sep 2017 10:12:58 -0600

Changed in gnome-shell (Ubuntu):
status: In Progress → Fix Released
Jeremy Soller (jackpot51) wrote :

Thanks very much!

mif (mifjpn) wrote :

Setting of GDM was GDM3.css.
But setting of screen lock is still ubuntu.css.
I found it.
Is it OK?

Jeremy Soller (jackpot51) wrote :

Yes mif, that will probably be an issue. I will write a patch.

Jeremy Soller (jackpot51) wrote :

I tried looking for ubuntu.css in gnome-shell 3.26.1-0ubuntu5, but I did not find it. Where do you see this issue mifjpn?

mif (mifjpn) wrote :

Thank you for checking source cord.
Simply, I made gdm3.css and ubuntu.css a different file. So I noticed.
But I noticed the version of GDM3 being old.
It's 3.26.1-3ubuntu3 on Ubuntu 17.10 and POP! OS.
I apologize for the confusion.
Is a problem corrected by future's upgrade?

mif (mifjpn) wrote :

The version could be confirmed. I apologize for my misunderstanding. I was lack of a skill.
 When I replaced a css file simply, a lock screen didn't change. I'm thinking its cause is here separately.

Jean-Pierre van Riel (jpvr) wrote :

I've noticed in 18.04.2 (upgraded from 16.04 LTS), with gnome-shell 3.28.3-0ubuntu0.18.04.4 and ubuntu-session 3.28.1-0ubuntu3, the *lock* screen is still pinning to /usr/share/gnome-shell/theme/ubuntu.css. Note, the login session screen is using the correct theme.

This is related: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1732450.

As per https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1732450/comments/5, the nasty I did to work around it shows the gdm3 / session lock screen theme is still pointed directly to /usr/share/gnome-shell/theme/ubuntu.css instead of /usr/share/gnome-shell/theme/gdm3.css.

I also checked the alternative symlinking, and indeed, `pop.css` was supposed to be used, yet the lock screen used ubuntu.css.

```
$ update-alternatives --display gdm3.css
gdm3.css - auto mode
  link best version is /usr/share/gnome-shell/theme/pop.css
  link currently points to /usr/share/gnome-shell/theme/pop.css
  link gdm3.css is /usr/share/gnome-shell/theme/gdm3.css
/usr/share/gnome-shell/theme/pop.css - priority 20
/usr/share/gnome-shell/theme/ubuntu.css - priority 10
```

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.