mate-desktop / mate-settings-daemon

MATE settings daemon
https://mate-desktop.org
GNU General Public License v2.0
44 stars 46 forks source link

MATE does not update wallpaper during monitor events when show-desktop-icons is set to false #335

Open nikp123 opened 3 years ago

nikp123 commented 3 years ago

Expected behaviour

With the icons disabled (dconf), I expect that the wallpaper updates upon change in display configuration. Basically just redrawing the background of the root window (in case of X11) when an RRScreenChangeNotify event is recieved.

Actual behaviour

The wallpaper does not update when plugging in a video output or when I change the monitor settings through the Control Center.

Steps to reproduce the behaviour

1) Set a wallpaper using said Control Center 2) Disable desktop icons in dconf 3) Plug/unplug video source or reconfigure existing displays

MATE general version

1.24.0

Package version

1.24.0-1 (Arch default repository)

Linux Distribution

ArchLinux

Link to downstream report of your Distribution

None

Notes

I've already created an issue, just on a different component of MATE (that I thought was the culprit) and got redirected here. Link to said issue: https://github.com/mate-desktop/mate-panel/issues/1136 Also as I've mentioned in the previous post, this is not a default setup and involves using different desktop components (such as i3wm, a different compositor and so on)

nikp123 commented 3 years ago

I've made a dumb workaround in the meantime

thomashuss commented 2 months ago

I'm still experiencing this on 1.26.0 on Debian 12. (I had also experienced on Arch for quite some time and never reported.) I wrote a simple C program to verify that the GTK monitors-changed event is emitted (it is). Running with mate-settings-daemon --replace --debug did not print the debug statement for screen size changed/unchanged. I'm not sure how to debug this further.

lukefromdc commented 2 months ago

This implies some code for updating the wallpaper in Caja never made it into mate-settings-daemon, from which the background is managed when Caja is not showing icons

nikp123 commented 2 months ago

This implies some code for updating the wallpaper in Caja never made it into mate-settings-daemon, from which the background is managed when Caja is not showing icons

Apologies for non-clarification, it in fact happens without Caja running in desktop mode (ie. as a bottom layer window).

This setup assumes that we're running a desktop which doesn't have a "desktop" window. Just a pure X11 root window background. I assumed it was a supported use case since the daemon does indeed update the X11 root window, just not when any monitor events happen.

PS: Or at least that's what I remember, because I haven't used this setup for at least 3 years now, sorry ;)

thomashuss commented 2 months ago

Let me preface this by saying I am not familiar with GTK so I don't know if I'm testing this right. Nonetheless, I wrote this test program which prints the resolution and listens for monitor changes in the same way as MSD. The correct resolution is sometimes printed after changing monitor settings in Displays or after (dis)connecting a monitor. However, the background is only reliably updated when the monitor settings are changed. Example output with just connecting and disconnecting monitors:

$ ./gtk_monitors_test
1920x1080  <-- disconnected 1920x1080 monitor => switch to 1920x1200 internal display
1920x1080
1920x1200
1920x1200  <-- connected 1920x1080 monitor => disable 1920x1200 internal display

I noticed that Caja's monitor change callback does not obtain screen size using the GdkScreen pointer passed to the callback function, instead obtains size of the screen belonging to what is apparently the desktop background window. Therefore I added the --window option to the test program, but creating the window yields the same result so I am not sure why it works in Caja but not here.

lukefromdc commented 2 months ago

Note that the GdkScreen is (I believe since GTK 3.10) a superset of all monitors and is basically the smallest rectangle that can be drawn around all of the monitors in a multimonitor setiup.