Recently i connected another display to my laptop, and after putting it in sleep mode and then removing the HDMI cable and after opening it up again i found my KDE plasma desktop missing, the taskbar, widgets and other "plasmoid" thingys, they were in the now disconnected display, even if it was not there.
For a fix i altered the following files on the premisse that KDE stores a lastdisplay property in a config file as means to remember where things belong, and in this sleep/disconnect thing this property did not got updated as it should.
The fix was to alter the property manually in the KDE plasma desktop file, it stores all the widgets and plasmoids data.
Back up your files if you dont know what you are doing!
$ cp ~/.config/plasma-org.kde.plasma.desktop-appletsrc ~/.config/plasma-org.kde.plasma.desktop-appletsrc.back
Set lastScreen=0
for some Contaiments on ~/.config/plasma-org.kde.plasma.desktop-appletsrc
:
...
[Containments][2]
activityId=
formfactor=2
immutability=1
lastScreen=0
location=3
plugin=org.kde.panel
wallpaperplugin=org.kde.image
...
[Containments][8]
activityId=
formfactor=2
immutability=1
lastScreen=0
location=3
plugin=org.kde.plasma.private.systemtray
wallpaperplugin=org.kde.image
...