I believe this should fix the winmm:mci occasional failure. The issue comes from the client surface being added to the surface list while it's not yet fully created and more precisely before its X11 client window has been created yet. This can happen in a rendering thread, and the window itself might be moved, resized or more specifically reparented from its owner thread at the same time. This causes all of the window client surfaces to be updated, which causes an XComposite redirect request to be sent without the X11 window yet associated with the surface. Later, when another XComposite unredirect request is sent with the X11 client window this time, it triggers an X11 error as the window has never been redirected. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10106