This is already fixed in Qt 5.11.1 and up with a combination of 67227aeffdf94be8d177309d27291d5b3247586c ("xcb: fix regression with remote X11 clients") and 5f1df771b6ea267b75553fce870d0c6bbe5e38ca ("xcb: re-factor QXcbConnection::printXcbEvent"). Unfortunately those are not feasible to backport (not even parts of it) and the patch attached to the Qt bugreport does it in an incompatible way, so it shouldn't be backported either. I guess we would need to write a hack^Wpatch ourselves?