Package: xfdesktop4
Version: 4.20.1-1
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.
* Steps to reproduce
* 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.
* 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.
* Proposed solution
- None. Based on what I've seen in xfdesktop4 4.20.1-1 in one afternoon of
code debugging, an Xfce desktop now depends on the existence of a monitor.
There's also a lot of other monitor dependent code added since 4.18.1-1. I don't
see any easy quick fix.
The only crazy solution I can think of is for the code to provide a "fake"
or "dummy" monitor so the rest of the Xfce code can work.
In fact I vaguely remember creating a dummy monitor in xorg.conf for VNC
purposes years ago. Maybe that's the workaround here???