I don't know if this can be of some use nor do I know if it is a peculiarity of my setup. I assumed that switching the monitor off is what causes kscreenlocker () to exit. That is incorrect. When the monitor is switched off, the screen is not removed. It is also worth noting that kscreenlocker (still without patch) works perfectly fine if it is executed when the monitor is off. It's when I switch it back on that the screen is removed and, after a split second, a new one is added. This causes all sorts of troubles to kscreenlocker. I have modified UnlockApp::desktopResized() to printout the number of screen available and launched kscreenlocker in a loop: $ while : ; do echo -e "\n\n\n*** starting at $(date)***"; echo "Monitor is $(cat /sys/class/drm/card0-DP-2/status)" ; greeter/kscreenlocker_greet --testing ; done As soon as the login screen was shown, I switched off the monitor and waited for about a minute. This is the output I got: *** starting at sab 13 feb 2016, 22.58.35, CET*** Monitor is connected UnlockApp::desktopResized() - Screen count: 1 Locked at 1455400716 file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/InfoPane.qml:52:22: Unable to assign [undefined] to int file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/UserPasswordPrompt.qml:25: ReferenceError: userModel is not defined file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/UserDelegate.qml:82:9: QML Image: Cannot open: file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/user-identity file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/UserDelegate.qml:82:9: QML Image: Cannot open: file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/system-log-out file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/UserDelegate.qml:82:9: QML Image: Cannot open: file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/system-switch-user org.kde.keyboardLayout: Layouts list changed: ("it") UnlockApp::desktopResized() - Screen count: 0 *** starting at sab 13 feb 2016, 22.59.32, CET*** Monitor is disconnected UnlockApp::desktopResized() - Screen count: 1 Locked at 1455400772 QXcbConnection: XCB error: 148 (Unknown), sequence: 170, resource id: 0, major code: 140 (Unknown), minor code: 20 UnlockApp::desktopResized() - Screen count: 2 file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/InfoPane.qml:52:22: Unable to assign [undefined] to int file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/UserPasswordPrompt.qml:25: ReferenceError: userModel is not defined file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/UserDelegate.qml:82:9: QML Image: Cannot open: file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/user-identity file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/UserDelegate.qml:82:9: QML Image: Cannot open: file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/system-log-out file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/UserDelegate.qml:82:9: QML Image: Cannot open: file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/system-switch-user org.kde.keyboardLayout: Layouts list changed: ("it") file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/InfoPane.qml:52:22: Unable to assign [undefined] to int file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/UserPasswordPrompt.qml:25: ReferenceError: userModel is not defined file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/UserDelegate.qml:82:9: QML Image: Cannot open: file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/user-identity file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/UserDelegate.qml:82:9: QML Image: Cannot open: file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/system-log-out file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/UserDelegate.qml:82:9: QML Image: Cannot open: file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/system-switch-user org.kde.keyboardLayout: Layouts list changed: ("it") My deductions are: 1) kscreenlocker exited as soon I switched the monitor back on, not when I had previously switched it off. 2) the while/do loop immediately launched a new instance of kscreenlocker, but the monitor was still being reported off by Xrandr; UnlockApp::desktopResized() reports one screen though 3) there's a strange QXcbConnection: XCB error 4) A new (the real one) screen is added and UnlockApp::desktopResized() reports TWO screens, the fake/virtual/whatever one is not removed). 5) At that point kscreenlocker showed *two* password windows If I add a "sleep 1" into the middle of the loop, the "QXcbConnection: XCB error doesn't happen", only one screen is reported by UnlockApp::desktopResized() and only one password window is shown.