Fixing a blank screen in KDE
I have Fedora 21 installed on my laptop (a ThinkPad) and use the KDE window manager. Recently (today, actually) I ran into a bizarre problem with it: after undocking it, the screen went blank. Or technically, it stayed blank instead of turning on, since when it is docked I only use external monitors (two hooked up via the DisplayPort outputs on the dock, and one connected to the DisplayPort output on the laptop itself). It took some troubleshooting but eventually I solved it.
The symptoms were as follows:
- Any time there were no external monitors connected, the screen would be blank.
- I could dock or plug in one external monitor (e.g. using an onboard display output) and reconfigure the displays such that the built-in display was enabled, but subsequently removing the external displays still disabled the built-in display.
- Rebooting didn’t help. The built-in display would be enabled and I could log in, but as soon as KDE loaded the display turned off.
From the above it was apparent that something in KDE was doing this. But what? If you’ve used KDE on a laptop you may have noticed that the display settings are remembered, which is really useful for a laptop. So for example if you dock the laptop, the settings you used when it was previously docked are remembered. The same applies if you connect an external monitor, or make any other change to the physical layout of the displays. Somehow, apparently the “wrong” display settings were being remembered for my laptop when no external monitors are connected.
First I poked around the Display and Monitor section in System Settings. I could configure the displays but I couldn’t find anything relevant for the issue. I searched Google a bit and didn’t find anyone reporting similar problems. I found complaints of the display settings not being remembered, but nothing completely applicable to my issue. What I did find was a possible culprit: KScreen. I couldn’t immediately find documentation useful for my issue so I took a look at the configuration myself. This meant checking out the contents of ~/.kde/share/apps/kscreen/. Personally I just used Konsole but Dolphin would have also worked. There I found text files with filenames that appeared to be checksums. There were a dozen or so such file, so I assume these represented each unique physical display configuration I’ve used with my laptop.
I was in a hurry so rather then trying to edit any of the files in the kscreen directory I went with the “nuke from orbit” option and deleted the entire directory. The very next time I unplugged the external displays the issue was solved, the built-in display was enabled, and I could actually use the laptop! The kscreen directory was regenerated, too. This issue was annoying to have but luckily it was an easy fix.