! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Ristretto fails to set a wallpaper
Status:
RESOLVED: FIXED
Product:
Ristretto
Component:
Application

Comments

Description Spass 2018-08-02 11:29:00 CEST
Hello, Ristretto fails to set up the wallpaper using the menu View -> Set as Wallpaper option. Clicking Apply or OK does nothing. Well, on Apply the 'Set as wallpaper' window blinks for a fraction of a second. Wallpaper stays unchanged. Maybe it's because some changes in the recent xfce4-settings / xfdesktop?

Ristretto 0.8.3 on fully-upgraded Xubuntu 18.10 with xfce4-settings 4.13.3 and xfdesktop4 4.13.2

Changing wallpaper from the Thunar's (1.8.1) right-click menu works fine.
Comment 1 Andre Miranda editbugs 2018-08-23 05:37:22 CEST
Monitoring the xfce4-desktop channel in xfconf, I found that's how the apps set the wallpaper

Thunar:
/backdrop/screen0/monitoreDP-1/workspace0/last-image = [picture URI]
/backdrop/screen0/monitor0/image-path = [picture URI]

Ristretto:
/backdrop/screen0/monitor0/workspace0/last-image = [picture URI]

xfdesktop:
/backdrop/screen0/monitoreDP-1/workspace0/last-image = [picture URI]

Obviously Ristretto needs to use the monitor name (eDP-1 in my case) not an index.

This is the part of code that needs to be checked:
https://git.xfce.org/apps/ristretto/tree/src/xfce_wallpaper_manager.c?id=5afe858ce9f1132d4ffc583c385354c15ba258e8#n224

Somehow gdk_screen_get_monitor_plug_name is not yielding a valid monitor name.

And this is how Thunar gets monitors names:
https://git.xfce.org/xfce/thunar/tree/plugins/thunar-wallpaper/twp-provider.c?id=a5fb15915541759008083804c53a1890c782e885#n252

Sorry, I have no time to put together a patch, I hope the provided info helps.
Comment 2 Anna Arad 2018-08-24 22:21:06 CEST
Created attachment 7907 
Patch

I don't have a multi-monitor setup to check every setting, but it should be just a basic fix for the problem.
I hope the rest is taken care of properly by ristretto :)
Comment 3 Andre Miranda editbugs 2018-08-26 00:42:58 CEST
@Anna, your patch improves the single workspace behavior, but doesn't fix the problem reported here, it only happens for users of xfdesktop 4.13.

Now I fully understand the problem. Ristretto tries to get the monitor name with gdk_screen_get_monitor_plug_name and for some reason it fails, it is expected, so RIstretto fallbacks to monitor number. But xfdesktop 4.13 uses gdk_display_get_monitor (gtk>=3.22), which works, so it doesn't fallback to monitor number.

I think we shouldn't try any hack or worry about gtk2 code, it make more sense to first port Ristretto to gtk3.
Comment 4 Anna Arad 2018-08-29 17:35:32 CEST
@Andre
Sorry, I missed the version stuff.
Just compiled the latest Ristretto code and made it work for me (because it hasn't initially).
So this might be a fix for a different bug that Ristretto doesn't set the wallpaper correctly when applied to all workspaces and is running in the "wrong" workspace.
Comment 5 Olivier Duchateau 2019-04-13 21:36:12 CEST
Created attachment 8405 
Fix wallpaper manager

This is a workaround for Xfdesktop >= 4.13.x, we can use a GDbusProxy in order to connect to the org.xfce.Xfconf service.

This fix requires another patch (bug #15286).
Comment 6 Igor editbugs 2019-07-01 18:10:24 CEST
Hi Olivier, does your patch work with both 4.12 and 4.13 versions of xfdesktop?
Comment 7 Olivier Duchateau 2019-07-01 19:34:36 CEST
Yes, it works for both version. It is fallback method when gdk_screen_get_monitor_plug_name() returns nothing, we use the org.xfce.Xfconf interface through GDBusProxy.
Comment 8 Git Bot editbugs 2019-07-01 20:22:24 CEST
Olivier Duchateau referenced this bugreport in commit 3778e10f1a32f49a8c8a16bfe9a65626c78f2ae6

Fix wallpaper manager

https://git.xfce.org/apps/ristretto/commit?id=3778e10f1a32f49a8c8a16bfe9a65626c78f2ae6
Comment 9 Igor editbugs 2019-07-01 20:23:05 CEST
Merged, thank you!
Comment 10 Igor editbugs 2019-07-02 00:06:12 CEST
The only problem is this patch doesn't work with multi-monitor configurations: for me, it always sets the wallpaper to the second monitor, no matter which one I choose.
Comment 11 Andre Miranda editbugs 2019-07-04 14:48:58 CEST
@Igor, maybe the problem is caused by a gdk_screen_get_monitor_plug_name regression[1] fixed in gtk-3.24.10[2] released yesterday.

1 - https://gitlab.gnome.org/GNOME/gtk/commit/cdd6fb32c53eec0c156181393f98d6e534ff9791
2 - https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-24/NEWS
Comment 12 Igor editbugs 2019-07-04 16:31:17 CEST
Andre, they may have fixed a regression, but, unfortunately, ristretto is still on gtk2.

The problem, as I see it, is that ristretto only knows about monitor number (0, 1...) while xfdesktop 4.13.x only operates with monitor names (LVDS-1, HDMI-1...).
There's no way that I see to get those monitor names out of gtk2 for ristretto.

Perhaps, xfdesktop could populate the numbers along with the names? Something like
      <property name="monitorHDMI-1" type="empty">
        <property name="number" type="int" value="1">
That could allow ristretto to match the number it knows with an xfdesktop monitor entry.
Comment 13 Andre Miranda editbugs 2019-07-04 18:15:10 CEST
Oops, I completely forgot that ristretto wasn't ported, sorry.
As I said in comment 3, I don't think it's worth implementing this for ristretto-gtk2 and I'm against the proposed change to xfdesktop.
OTOH, why not push the ristretto port and disable the (broken) thumbnail bar? We can try to fix this later, whoever doesn't want to lose that bar can stick with 0.8.x for the time being.
Comment 14 Git Bot editbugs 2019-08-06 19:11:29 CEST
Igor referenced this bugreport in commit b9e367ecc67ad716a4f5c3b2bb4ea4c917ce0b50

Support for setting background image for both gtk2 and gtk3 versions of xfdesktop

https://git.xfce.org/apps/ristretto/commit?id=b9e367ecc67ad716a4f5c3b2bb4ea4c917ce0b50

Bug #14571

Reported by:
Spass
Reported on: 2018-08-02
Last modified on: 2019-08-06

People

CC List:
4 users

Version

Attachments

Patch (1.25 KB, patch)
2018-08-24 22:21 CEST , Anna Arad
no flags
Fix wallpaper manager (4.45 KB, patch)
2019-04-13 21:36 CEST , Olivier Duchateau
no flags

Additional information