Short description of error
When using Blender with multiple-windows, you can't use Clay, or Eevee.
The OpenGL 3.3 core profile documentation, Appendix D, page 336 clearly states that:
Framebuffer, query, and vertex array objects are not shared.
If we force OpenGL context to share every single resource, things work. To try this in Linux you can apply the following hack/patch: P596. However this doesn't work well if user has multiple graphic cards and move windows around between them. In Blender we only resort to that if user has intel cards.
First and foremost we need to get rid of static allocated elements as we do now in places like draw_cache.c. They can safely be moved to a struct owned by the Window, while some global stuff could be owned by WindowManager.
Second we need a non-shared-OpenGL-resources-manager. A system that allocates and retrieve them per window. We need this for OpenSubdiv as well, since we also rely on VAO there. Ideal solution and implementation open for discussions.