http://bugs.winehq.org/show_bug.cgi?id=29236
--- Comment #10 from rocko rockorequin@hotmail.com 2011-12-18 20:25:16 CST --- VGL does use XShmPutImage in its bitblitter to copy the rendered image back to X. I checked and it is after the call in VGL that the BadDrawable is happening (not wine's call to it in dib.c).
VGL does trap calls to XDestroyWindow and shuts down the corresponding bitblitter (for reference, the issue I opened at VGL is at https://sourceforge.net/tracker/?func=detail&atid=678327&aid=3461176... and there's an explanation there).
Is there any chance at all that there is a thread-sync issue in wine where the context gets destroyed but slightly later another thread tries to render to it? IIRC, in a single-GPU system, X errors like BadDrawable don't bother wine but VGL by default bombs out on them. If that's true, might the BadDrawable error be occurring in a single-GPU system in wine 1.3.34 but just not causing any problems?