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 765687 - White background on desktop after switching to Adwaita
White background on desktop after switching to Adwaita
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Desktop
3.20.x
Other Linux
: Normal normal
: 3.20
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 761406 766963 769132 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-04-27 17:33 UTC by Sebastian Keller
Modified: 2016-09-09 13:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
application: Fix white desktop after changing themes (1.57 KB, patch)
2016-04-28 23:42 UTC, Sebastian Keller
committed Details | Review
nautilus.css: fix opaque desktop window after theme change (921 bytes, patch)
2016-08-07 10:43 UTC, Ernestas Kulik
committed Details | Review

Description Sebastian Keller 2016-04-27 17:33:09 UTC
Nautilus adds both "Adwaita.css" and "nautilus.css" with application level priority [1] and gtk seems to always give the provider added last a higher priority in such a case. Usually this works fine, because "Adwaita.css" is added before "nautilus.css" and "nautilus.css" is what turns the background transparent. But when changing themes, this can break, because only "Adwaita.css" is being removed/added which can result in a situation where "Awaita.css" is the one added last. This would cause the ".nautilus-window" selector to change the background of the desktop to the base color rather than transparent. One way to trigger this is to change the theme and then change it back to Adwaita while nautilus is running and showing desktop icons.

So depending on whether the gtk behavior regarding the priority is correct, there are different ways of fixing this:

If the gtk behavior is correct, then "nautilus.css" could always be reloaded along with "Adwaita.css" or it could be loaded with "GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 100" priority. Both solutions seem like ugly hacks to me, but I think the first solution seems a bit saner.
Or maybe the ".nautilus-window" class could be removed from the desktop window.

If this is a bug in gtk and the priority of the selectors should depend on their specificity alone rather than the order in which the providers have been added, that means that there is a bug in the "nautilus.css" being covered up by this. "nautilus.css" uses an element selector ("nautilus-desktop-window") while "Adwaita.css" uses a class based selector (".nautilus-window") to change the background. However class selectors always take priority over element selectors and nautilus-desktop-window also has the ".nautilus-window" class. So the fact, this is currently working is due to "nautilus.css" being loaded last (except after theme changes) and thereby taking priority. So once gtk fixed this would need to be fixed in nautilus by changing the selectors in "nautilus.css" to use "nautilus-desktop-window.nautilus-window".

(Some of the selector names are 3.20 specific, but the general idea should be the same for master)


[1] https://git.gnome.org/browse/nautilus/tree/src/nautilus-application.c?h=gnome-3-20&id=a57096df993eb44795db8ff8de47bde643c38b1e#n1075
Comment 1 Carlos Soriano 2016-04-28 08:45:24 UTC
Thanks for digging into this. Could you file a bug report to gtk+ about that? Although I guess the priorities are needed.

Also, would you like to cook a patch for Nautilus?
Comment 2 Carlos Soriano 2016-04-28 08:47:52 UTC
forgot to mention, would be good for gtk to respect the selectors. If that cannot be possible, then the "reload nautilus.css alongside adwaita.css" sounds like the best approach.
Comment 3 Sebastian Keller 2016-04-28 17:51:01 UTC
I filed a bug report against gtk about the priority issue:
https://bugzilla.gnome.org/show_bug.cgi?id=765737
Comment 4 Sebastian Keller 2016-04-28 23:42:02 UTC
Created attachment 326976 [details] [review]
application: Fix white desktop after changing themes

This is the patch using the priority + 1 solution as suggested in the gtk bug report. I've tested it on master and the 3.20 branch and it fixes the issue in both.
Comment 5 Carlos Soriano 2016-05-02 13:01:42 UTC
Patch looks good to me while gtk+ does priorities on style providers.
Thanks a lot for spending the time to cook a patch and investigate!

Attachment 326976 [details] pushed as 1587ee8 - application: Fix white desktop after changing themes
Comment 6 Jeremy Bicha 2016-05-28 19:30:39 UTC
*** Bug 766963 has been marked as a duplicate of this bug. ***
Comment 7 maofree 2016-06-10 22:38:54 UTC
Hi
I get the same error on arch linux with gnome 3.20.2

bye
Comment 8 Carlos Soriano 2016-07-25 07:29:09 UTC
*** Bug 769132 has been marked as a duplicate of this bug. ***
Comment 9 Inactive account 2016-08-05 10:03:37 UTC
When I got this issue previously it was not with a white background, but with this grey one: https://launchpadlibrarian.net/262110959/Background_Not_Shown.png

Anyhow, the patch fixed my issue, however now that I have installed the latest version of the Numix GTK Theme it is back, and doesn't go even if I change back to Adwaita now, which previously did fix the issue. The first time it happened was when I changed to Numix, when I changed back to Adwaita that seemed to fix the issue, and it did go on and off with the Numix theme, so it wasn't present the whole time at first.

But now, and I think it did coincide with me restarting an unresponsive Nautilus, no matter what I do, restarting gnome-shell, restarting Nautilus, changing the GTK theme back to Adwaita, nothing, it is now constantly grey, though not in the Activities Overview, nor in the gnome-control-center "Background" part, they all show it as it is meant to be.
Although if I am to end the Nautilus process, then my desktop background shows as it is meant to everywhere.

So should this bug be reopened? Or should I file a new one? Or...?
Comment 10 Inactive account 2016-08-05 10:10:35 UTC
Though to make it clear, when starting Nautilus again the issue does return. But it is not present when Nautilus is not either.
Comment 11 Inactive account 2016-08-05 10:11:13 UTC
If I end the Nautilus process and then start it from Terminal this is the output:


(nautilus:11557): Gtk-WARNING **: Failed to register client: GDBus.Error:org.gnome.SessionManager.AlreadyRegistered: Unable to register client
Initializing nautilus-dropbox 2015.10.28

(nautilus:11557): Gtk-WARNING **: Theme parsing error: <broken file>:1:0: Failed to import: The resource at '/org/gnome/libgd/tagged-entry/default.css' does not exist
Nautilus-Share-Message: Called "net usershare info" but it failed: 'net usershare' returned error 255: mkdir failed on directory /var/run/samba/msg.lock: Permission denied
net usershare: cannot open usershare directory /var/lib/samba/usershares. Error No such file or directory
Please ask your system administrator to enable user sharing.
Comment 12 Carlos Soriano 2016-08-05 12:27:29 UTC
Let's reopen and investigate further.
I understood correctly you are in 3.20.2 right?
Comment 13 Inactive account 2016-08-05 12:55:13 UTC
My system tells me that I am using gnome-shell version 3.20.3, but it says that I am using Nautilus version 3.20.1. These are the latest versions available to me with my distro. Do I need to contact my distro and ask them to update the versions they provide?
Comment 14 Carlos Soriano 2016-08-05 14:32:47 UTC
(In reply to maofree from comment #7)
> Hi
> I get the same error on arch linux with gnome 3.20.2
> 
> bye

Can you double check it's Nautilus 3.20.2? It took long to do this release.
Comment 15 Carlos Soriano 2016-08-05 14:33:32 UTC
(In reply to cooks.go.hungry from comment #13)
> My system tells me that I am using gnome-shell version 3.20.3, but it says
> that I am using Nautilus version 3.20.1. These are the latest versions
> available to me with my distro. Do I need to contact my distro and ask them
> to update the versions they provide?

yes, although probably they are already aware. We did Nautilus release just a few days ago, not in sync with the rest of GNOME.
Comment 16 Jeremy Bicha 2016-08-05 14:39:39 UTC
(In reply to Carlos Soriano from comment #14)
> Can you double check it's Nautilus 3.20.2? It took long to do this release.

Ubuntu 16.04 with the GNOME3 Staging PPA still has nautilus 3.20.1 but 2 weeks ago we cherry-picked https://git.gnome.org/browse/nautilus/commit/?h=gnome-3-20&id=8c0f5970e
Comment 17 Inactive account 2016-08-06 19:54:21 UTC
So what's happening? Do you need anything from me at the moment or are we waiting for something? Just this bug is really annoying me, I have to end the Nautilus process in order to see my desktop background.
Comment 18 Inactive account 2016-08-06 21:58:10 UTC
Also, though this does not always seem to be the case, about half the time if I switch back to Adwaita the problem with the desktop goes away, at least temporarily.
Comment 19 Carlos Soriano 2016-08-07 08:33:47 UTC
(In reply to cooks.go.hungry from comment #17)
> So what's happening? 

I guess we don't know.

> Do you need anything from me at the moment or are we
> waiting for something? 

Waiting to someone to investigate further I guess.
I couldn't reproduce so far.
Comment 20 Ernestas Kulik 2016-08-07 10:43:08 UTC
Created attachment 332882 [details] [review]
nautilus.css: fix opaque desktop window after theme change

The background of the window paned is not set to be transparent, which
may cause it to become opaque when changing themes. This commit sets its
background color in the style sheet.
Comment 21 Ernestas Kulik 2016-08-07 10:45:20 UTC
This should fix the issue with Numix. Other themes may cause the same problem in other ways.
Comment 22 Inactive account 2016-08-07 22:17:27 UTC
Well, until a fix for this has been pushed out. I have found that disabling desktop icons in the gnome-tweak-tool seems to fix it.
Comment 23 Carlos Soriano 2016-08-08 08:16:20 UTC
Review of attachment 332882 [details] [review]:

oh I see what's going on. Thanks Ernestas!!

Feel free to backport to 3.20
Comment 24 Ernestas Kulik 2016-08-08 08:42:59 UTC
Attachment 332882 [details] pushed as 0f6ff85 - nautilus.css: fix opaque desktop window after theme change
Comment 25 Debarshi Ray 2016-09-09 13:02:04 UTC
*** Bug 761406 has been marked as a duplicate of this bug. ***