The error message is a direct consequence of your application freezing. The wm window manager passes user-input events to its clients. If the wm client does not collect the events in the Qt event loop before the server-local queue is full, the server emits this warning and resets the queue. This way, a temporarily stuck client could later pick-up the most recent events addressing its windows.
Unfortunately, I don’t have any idea, why your application freezes outside the Qt event loop.
Yes, you’re right. I was looking at the issue the other way around and initially thought that the full event queue was causing the deadlock, whereas the full queue was actually a consequence of the deadlock.
I found and fixed the underlying issue. Thanks for the explanation!