http://bugs.winehq.org/show_bug.cgi?id=29236
--- Comment #12 from rocko rockorequin@hotmail.com 2011-12-19 03:18:36 CST --- Is the window actually being destroyed, though? eg in the log I posted, does the resource 0x460000f get destroyed? I can see some contexts getting destroyed, but does this affect the window - don't you have to call XDestroyWindow on it explicitly?
I think the error is actually happening independently of a call from wine - it is occurring when VGL is bitblitting the result of an OpenGL render back to the X11 window - so there is no call chain to propagate the error back along. VGL catches all the XDestroyWindow calls and stops itself writing back to the destroyed windows. I put code into VGL to confirm this, and I could see XDestroyWindow calls for other windows, but not for the resource that is causing the BadDrawable error. So shouldn't the resource still be valid? What else might cause it to be invalid??