4.20.1-1: When no monitor is connected, the Xfce desktop has no icons, background image, or context menu
# Issue Description
If the user runs the Xfce desktop remotely (example, using VNC) and the PC doesn't have a monitor connected, the Xfce desktop doesn't show any icons, background image, or a right-click menu. This problem was found in Debian 13 Trixie, xfdesktop4, 4.20.1-1.
# Steps to Reproduce Issue
* Requirements
- Another PC with a VNC client installed.
* Setup (VNC server)
- Install a VNC server: sudo apt-get install x11vnc
- Manually run it in a console: x11vnc -display :0 -forever
- Connect the 2nd PC's VNC client to the test PC.
* Reproduce the bug
- Unplug all video cables from the PC.
- Open a console and run "xrandr" to confirm that no monitors are connected.
- On my test PC, this is enough to eliminate the background image, desktop icons, and right-click menu.
- Run "xfdesktop --quit" to stop the current instance.
- Run "xfdesktop" to start a new instance.
- The desktop icons, background image, etc are still not loaded.
# Expected Behavior
In Debian 12 Bookworm's xfdesktop4 (4.18.1-1), the desktop icons, background image, etc are loaded, even when no monitor is connected.
# Additional Information
* Analysis
- The problem occurs in xfdesktop_application_start().
```
GList *monitors = xfw_screen_get_monitors(app->screen);
for (GList *l = monitors; l != NULL; l = l->next) {
XfwMonitor *monitor = XFW_MONITOR(l->data);
screen_monitor_added(app->screen, monitor, app);
}
```
When a monitor is connected, xfw_screen_get_monitors() returns a list of detected monitors. The code manually calls the handler function screen_monitor_added(), which eventually creates an Xfce desktop for that monitor.
-
But when there are NO monitors, xfw_screen_get_monitors() returns NULL, so screen_monitor_added() is skipped. As a result, no Xfce desktop is created, no icons, background, etc.
Debian 12 Bookworm's xfdesktop4 (4.18.1-1)'s xfdesktop_application_start() doesn't have this code that detects monitors and adds Xfce desktops to each monitor. It always goes straight into creating a new Xfce desktop, even if there are no monitors.
* debian bug URL
* In case you need this, the bug URL I filed on bugs.debian.org is: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1119967
issue