Lock screen wallpaper does not respect monitor index
NixOS unstable, xfce4-screensaver git 89618254, gtk3 3.24.41, glib 2.78.4.
Let's say monitors are 0-indexed.
I have 2 monitors and when trying to unlock on the monitor 1
I found it shows wallpaper used by the monitor 0
, I would expect wallpaper used by monitor 1
to be shown instead. I honestly do believe this is supported since 49c3db8c, looking at the prefix = g_strconcat("/backdrop/screen0/monitor", monitor_name, "/workspace0", NULL);
line.
My settings:
$ xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitoreDP-1/workspace0/last-image # monitor 0
/var/lib/wallpaper/bobby285271/current.jpg
$ xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitorDP-2/workspace0/last-image # monitor 1
/nix/store/rgpv71rr27kvixlpj92v6xnx6l7m6l30-xfdesktop-4.18.1/share/backgrounds/xfce/xfce-shapes.svg
I tried looking at things, after adding & printing some debug messages I think here are the observations I saw so far (ordered by the time it happened to me), here I am unlocking from monitor 1:
- In
src/xfce4-screensaver-dialog.c
, a--monitor=
arg is accecpted, from my testing the value passed here is correct (the globalmonitor_index
is set to 1). - In
popup_dialog_idle
, a newgs_lock_plug
is created here.- In
src/gs-lock-plug.c
,gs_lock_plug_add_login_window
is triggered, it callsredraw_background
, which callsget_draw_dimensions
. - In
get_draw_dimensions
, it gets the monitor, usingplug->priv->monitor_index
. Here it looks likeplug->priv->monitor_index
is still 0 - Now
xfce_bg_load_from_preferences
fetches the wallpaper from my above settings viaxfce_bg_get_property_prefix
, and we got the wallpaper used by monitor 0. -
gs_lock_plug_add_login_window
finishes.
- In
-
g_object_set(widget, "monitor-index", monitor_index, NULL);
happens.- In
gs_lock_plug_set_monitor_index
,plug->priv->monitor_index
is now set to 1.
- In
To verify the monitor = gdk_display_get_monitor (display, 1);
, and as expected it is now always showing wallpapers used by monitor 1 now. I guess the problem here is that we are setting the monitor index property too late?
(Anyway thanks for reading this issue!)