LightDM doesn't show the user background

Hello,
I have an issue on Ubuntu Mate (16.10): as the title says, I am unble to make it display my user background on the LightDM screen. The option to do so is active in the LDM Gtk Settings Manager and I can’t find anything in the conf files (either in /etc/lightdm or /usr/share/lightdm) that would prevent this behaviour.

It’s worth noting that I don’t have the same issue on Xubuntu and it happens on Ubuntu Mate even when using a different Gtk greeter (and uninstalling Mate’s one, as it has a too high priority anyway). In fact, I have made my own Gtk greeter conf and it has the same behaviour: default background on Ubuntu Mate and user’s one on Xubuntu.

I suspect this may have to do with the default LightDM conf files on Ubuntu Mate (independantly of the Mate Gtk greeter, as the issue happens even when removing it), though I am unable to find where it could come from.

Any idea?

I don’t know if the following is related, but I have noticed one thing. If I set a user background (on either the login screen, the desktop or both) that I have stored on a drive or partition other than the one the OS is installed on, it will not load the background. This is on 16.04. So, I presume it will be the same on 16.10.

If I then choose “change desktop background” from the desktop context menu, the simple act of opening this brings up the missing background. Furthermore, if I then log out to the login screen, the background appears there as well. This suggests to me that partitions and/or drives that are not the main OS one are being brought on-line after the background has been called and so the background is not getting picked up during or following login.

My solution has been to make sure any personal backgrounds I use are always stored in my home folder on the main OS partition. Then this particular problem goes away

There’s a long standing bug (feature?) in LightDM that makes it unable to use a user background if it doesn’t have the right permissions. I guess it has to be readable by the LDM daemon, so rw-r–r-- should do the trick but depending of the way your drive is mounted (especially if it’s not using a Linux filesystem), it might not be possible to set them correctly.

Anyway, that’s not really related to my problem, as my pictures are in my home dir and, as I said, my custom greeter works fine on Xubuntu, the issue only appears on Mate but I can’t figure out why after checking every conf file.

But you’re saying that if your background is in your home, the LightDM screen shows it correctly? even with the Ubuntu Mate default Gtk greeter?

1 Like

I might have a clue as to why LightDM is unable to set the user image (it’s a bit of a shot in the dark): it looks like it gets the background image path from Gsettings. I wonder if it’s simply an issue of it not knowing where to find it on Mate…

I can’t find where it’s stored in Xfce, though. Maybe LightDM has a special case when it comes to handle the DE?

Summoning @Wimpy: any idea as to why LightDM doesn’t show the user background on Mate? Is there something in the Mate settings that specifically blocks it? Are there known issues between LightDM (with the Gtk+ greeter) and Mate?

Yes, indeed. If it is in my home folder, the Greeter picks it up for the login screen with no problem

Mmm, so either this is an issue that is specific to 16.10 (I know LightDM has changed the way its conf files are handled but I don’t know when) or it’s specific to my setup, but it happens both on my main PC and my laptop (which has a fresh install of Ubuntu Mate).

I’ll try on 16.04 in a VM to see how it goes.

I should add, if it is in the user/share/backgrounds folder the greeter picks the file up as well. So, in other words, as long as it is in my main OS partition, it is picked up. The reason I referred specifically to my home folder was because of extra, personal backgrounds I may decide to use. This is on 16.04 64 bit

So, I’ve tried Ubuntu Mate 17.04 alpha 2 (in case the issue was with LightDM and it had been updated) and 16.04.1 (up to date). In both cases, the issue is present.

Are you using an alternative greeter or Ubuntu Mate’s default one? In the latter case, have you updated the conf file? I’m asking this because the one from Mate specifically disable the user background in its conf file (but it doesn’t work better for me by changing this option).

I am using the default one and have made no edits to any conf files for it

for clarity:

Release 16.04.1 LTS (Xenial Xerus) 64-bit

Kernel Linux 4.4.0-59-lowlatency x86_64

MATE 1.12.1

Just to be sure: you simply set a picture as desktop background and it appears on the login screen, you don’t set it in the LightDM GTK+ system settings?

No. To set the desktop background I use the normal background chooser. See below:

To set the Greeter background, I use the greeter settings. See below:

Oh, ok. So that confirms it’s not my issue.

The thing is that you shouldn’t have to set the background in the LightDM GTK+ Greeter settings at all, LightDM is supposed to set the user background with the option “Use user wallpaper if available” (which is supposed to be on by default, I assume you unchecked it, or maybe it’s because of Mate’s default conf file), which overrides the background set in the configuration.

My problem is that however the settings are tweaked, the desktop background is not used instead of the LightDM background, whatever greeter is used. It works fine on Xubuntu (and probably other DEs) but not on Ubuntu Mate for reasons that are a complete mystery to me. My best guess is that LightDM is unable to get the path to the background due to the way Mate stores its settings.

Ah…right. I didn’t realise that was supposed to be a feature. I have always set the backgrounds independently, even if it was the same background being used.

I’ve just installed xubuntu-desktop on my main PC alongside Mate. After setting a desktop background in Xfce, it appears fine on the LightDM login page, so it seems to confirm that the issue is LightDM being unable to get the background file path from Mate.

Ok, I’ve found where the issue is via a similar bug in Cinnamon: mate-settings-daemon doesn’t use AccountsService, or doesn’t have a specific plugin to manage the background with it. Basically, the daemon is supposed to update the file /var/lib/AccountsService/users/username through gsettings to add/update the background in the User section. This value is then used by LightDM to fetch the user background and display it as expected.

I’ve updated a bug report I had opened on Launchpad.
EDIT: opened one too on GitHub for msd.

(cc @Wimpy)

1 Like

I’ve managed to make a script that fixes the issue. It might be a quick a dirty hack, but it works. Hopefully, the functionnality will be properly integrated in mate-settings-daemon at some point.

#!/bin/bash

function setuserbackground(){
	export USERBACKGROUND=`gsettings get org.mate.background picture-filename | tr -d "'"`
	dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.Accounts /org/freedesktop/Accounts/User`id -u` org.freedesktop.Accounts.User.SetBackgroundFile string:"$USERBACKGROUND"
}

setuserbackground

dbus-monitor --profile "type='signal',interface='ca.desrt.dconf.Writer',path='/ca/desrt/dconf/Writer/user',arg0path='/org/mate/desktop/background/'" |
while read -r line; do
	setuserbackground
done

Put it in /usr/bin (I called it msd-background-helper), make it executable and run it at session start. You can put the following msd-background-helper.desktop in /etc/xdg/autostart so that it’s started on each session automatically:

[Desktop Entry]
Type=Application
Name=MATE Settings Daemon Background Helper
Comment=Sets the user background in AccountsService on MATE
Exec=/usr/bin/msd-background-helper
OnlyShowIn=MATE;
X-MATE-Autostart-enabled=true

I’ll try to make a proper deb package for easier distribution and installation.

Note that the default Ubuntu Mate LightDM GTK greeter disables the user background option, so you’ll have to activate it through the LightDM GTK+ Greeter Settings that’s in System → Administration (“use user wallpaper if available”).

1 Like

@Wimpy: do you think this could/should be added directly in Ubuntu MATE?

I’m thinking about it. The script needs cleaning up a little, might be better to run it periodically than perpetually.

If I’m not mistaken, the content of the loop triggers only when dbus-monitor sends a signal when the background is changed.

Yeah, but there is a perpetual bash process running to provide it.