x11/gl is not thread-safe, so all x11/gl related API should be called from one thread. There's already a dedicated thread for GL calls, so move all x11 API calls to GL thread using gl.Do(...) Fixes golang/go#11066 Change-Id: If84a8d56e978ce30d7fbbc310740fcc794ce61d7 Reviewed-on: https://go-review.googlesource.com/10744 Reviewed-by: Nigel Tao <nigeltao@golang.org>