I don't know why this actually fixes it. It seems like some sort of bug in Xlib possibly, doing XSync here instead of the xcb method ends up mucking the xcb numbers in a way which results in future xcb usages deadlocking (and so does other future Xlib calls?). If the xcb sync is done manually, the numbers work out just fine and Xlib interacting with it afterwards (via XSync or otherwise) also works out fine. Doesn't make much sense...
(For debugging, see p x11::gameConnections[0]->out.request_written and p x11::gameConnections[0]->in.request_read with Ruffle for seeing the odd numbers)
I don't know why this actually fixes it. It seems like some sort of bug in Xlib possibly, doing XSync here instead of the xcb method ends up mucking the xcb numbers in a way which results in future xcb usages deadlocking (and so does other future Xlib calls?). If the xcb sync is done manually, the numbers work out just fine and Xlib interacting with it afterwards (via XSync or otherwise) also works out fine. Doesn't make much sense...
(For debugging, see
p x11::gameConnections[0]->out.request_written
andp x11::gameConnections[0]->in.request_read
with Ruffle for seeing the odd numbers)