A picture is worth a thousand words. You can see the bug in the screenshot attached as an attachment.
Created attachment 3725 The screenshot of the bug
The problem was that X11 recognized two output devices. But I only used one of them, and it seemed as if X11 tried to put two X11 servers into one. After disabling an unused output in xorg.conf, The problem is fixed. The same phenomenon manifests also on KDE.