When unplugging the external monitor, the laptop does not switch to its own screen (DP-0)
Submitted by Konstantin Yegupov
Assigned to Xfce Bug Triage
Description
This looks like another version of https://bugzilla.xfce.org/show_bug.cgi?id=9501
After unplugging the external HDMI monitor, the laptop (HP Elitebook 1050 running xubuntu 19.04) fails to switch to its own screen, leaving me with no display whatsoever.
Event log from the daemon:
xfce4-settings(displays): RRScreenChangeNotify event received. xfce4-settings(displays): Refreshing RandR cache. xfce4-settings(displays): Detected CRTC 442. xfce4-settings(displays): Detected CRTC 443. xfce4-settings(displays): Detected CRTC 444. xfce4-settings(displays): Detected CRTC 445. xfce4-settings(displays): Detected output 471 DP-0. xfce4-settings(displays): Noutput: before = 2, after = 1. xfce4-settings(displays): Output disconnected: HDMI-0 xfce4-settings(displays): Disabling CRTC 442. xfce4-settings(displays): No active output anymore! Attempting to re-enable the internal output. xfce4-settings(displays): RRScreenChangeNotify event received. xfce4-settings(displays): Refreshing RandR cache. xfce4-settings(displays): Detected CRTC 442. xfce4-settings(displays): Detected CRTC 443. xfce4-settings(displays): Detected CRTC 444. xfce4-settings(displays): Detected CRTC 445. xfce4-settings(displays): Detected output 471 DP-0. xfce4-settings(displays): Noutput: before = 1, after = 1.
The likely culprit is this condition:
if (g_str_has_prefix (output->info->name, "LVDS") || g_str_has_prefix (output->info->name, "eDP") || strcmp (output->info->name, "PANEL") == 0)
Apparently, only these hardcoded markers are expected and my "DP-0" is not good enough.
I think more sensible behaviour would be to try and switch to the only available output, regardless of whether it looks like the laptop panel or not. Or allow to override the marker values. At the very least, this code can use comments as to why these values have been chosen.
Version: 4.13.4