Page 1 of 1

[Troubleshoot] Wallpaper resolution issue with multi-displays of different sizes

Posted: Wed Aug 21, 2019 12:47 am
by brunonzanette
Hello, folks. I've been debugging this issue for a while and i can't figure out where the problem resides.

The bug is: The wallpaper resolution is bugged when used in more than one display of different sizes. The system correclty detects the displays resolutions but it always uses the image adjusted for the display 0 for all the monitors. The wallpaper resolution will be lower than the expected on higher resolution displays if the display 0 has a lower resolution, even if the original image has a higher resolution.

My test case is the following: I have 2 displays, the notebook display with 1366x768 resolution and a monitor with 1920x1080 resolution. My notebook is a Intel
i5-8250U with a Nvidia MX150 video-card, and i've tested it using both nvidia and intel drivers. The display 0 is the notebook and the display 1 is the monitor. I set a wallpaper and everything looks right, then i restart my session and the wallpaper on the disp1 is lower than expected. Every time i set a new wallpaper it works fine, but as soon as i restart the session it gets bugged.

Digging a bit i discovered that the system correctly detects both resolutions and create 2 image files converting the wallpaper file to the proper resolution of each display. These files are stored in "~/.cache/wallpaper" or "~/.cache/mate/background", depending on the DE. Then i created a script that adds to these image files a mark containing the display ID and the resolution, both extracted from the filename. After executing the script i restart my session and then the mark appears, as the cached files are loaded. With this test i noticed that it always uses the file created for the disp0 for both displays, regardless of the resolution, and ignores the other file.

The script can be accessed at the following link. It's very simple and it only modify the files on .cache folder, that can deleted to undo the changes. ...

I've done this test with the following systems so far: Mint Cinnamon, Mint Mate, Ubuntu Mate, Fedora Cinnamon, Ubuntu Gnome, Ubuntu KDE and Ubuntu XFCE.

The problem doesn't happen with Gnome, KDE and XFCE, but it affects all distros with Cinnamon and Mate, even when it's run via VirtualBox with a Gnome host (that works correctly). I couldn't make the script to work with Gnome, KDE and XFCE, but it's noticeable that it's correct. I took screen-shots of some these tests, always using the same wallpaper to be able to visually compare the results, and compiled in order to debug them. These screenshots can be accessed via this link (it's a lot of high res images, so i thought it would be better to share like this): ... 1rSpZ_uHIS

Notice that in every test the system uses the disp0 file for both displays and that the file created for disp1 exists.

I first thought that the bug is specifically related to Mint Cinnamon, but i totally discarded it when i noticed that it also affects other distros and DEs. So my guess is that it has something to do with the Window Manager (Marco/Muffin) but it's just a guess. Once i don't know that much about how these WM works nor exactly which program is responsible for adjusting and setting the wallpaper for each DE i came here to ask for help on troubleshooting these problem.

My first doubt is: Does it also affects AMD or pure Intel machines? Can someone run the script to test it? (i don't have these machines to do it myself)

Second: Which program is responsible for doing this job?

Any help is very welcome! Thanks!

Re: [Troubleshoot] Wallpaper resolution issue with multi-displays of different sizes

Posted: Sat Sep 07, 2019 1:59 am
by brunonzanette
I did a little bit more research and i've found out that changing property "X-GNOME-Autostart-Phase" of file "/etc/xdg/autostart/cinnamon-settings-daemon-background.desktop" from "Initialization" to "Panel" solve partially the problem. After doing that the system at least detects that my main display (as the list bellow) is the 1920x1080 one and than sets the 1080p image as wallpaper_0 (~/.cache/wallpaper/0_*), which is used for both monitors. I believe that this is due the execution of Xrandr being concluded after the initialization of background's daemon (maybe because my slow HD?).

0: +*HDMI-1 1920/521x1080/293+0+0 HDMI-1
1: +eDP-1 1366/344x768/193+1920+190 eDP-1

Anyhow, the bug still not fully solved because wallpaper_0 (~/.cache/wallpaper/0_*) is being used for both monitors, instead of 0 for display0, 1 for display1, ...

Any thoughts?