in other words, say, I have some OpenGL game which runs fine in fullscreen mode, but I cannot say the same about the SFML example. so, there's something wrong with the SFML example, not my "system".
That's not how it works. I can honestly say, since I've worked with SFML code for quite a while, that SFML does not rely on
any undefined behaviour, and if somebody notices it does, it would get corrected as soon as possible. It follows interface and API specifications to the letter. If an interface or API does not behave like the specification requires it to, then we cannot guarantee proper behaviour. Whether the developers of this OpenGL game you are able to run know this and coded a workaround, or whether they just got lucky and don't rely on the same behaviour that SFML does, I do not know.
The fact that in your first post, the log shows that an XKeyboard event is sent to the SFML event loop although we didn't register for any is already non-conforming. The X protocol promises this would not happen, and yet it does,
only on your system, so either the version of the X server you have installed is bugged in some obscure way (not unlikely considering X is a buggy mess anyway), or something else that is specific to your system is causing it to malfunction (library dependencies etc.).
Simply saying X works and Y doesn't, so it's definitely Y's fault because they both rely on a
common set of dependencies is firstly not fair and secondly not productive. Don't call this a bug, it isn't a bug in SFML until you can prove it properly. Nobody else (so far) can reproduce your issue, and even you can't reproduce your issue on another system. I'm even going so far as to say that if you installed a second copy of Ubuntu on the same machine the problem will disappear as well. You are the one who has to become active and take the initiative and try to isolate the problem since nobody else can. We can always help, but in this case you are going to be the one who has to do the majority of the work.