Understand xgbutil concurrency and thread safety
masterThread Safety
xgbutil is designed to be thread-safe. While the underlying X event loop in the xevent package is implemented sequentially, you can safely assume xgbutil itself is thread-safe.
Concurrency Model
By default, the library follows a sequential model. The complexity of making the main event loop generally concurrent is avoided by letting the user spawn concurrent code at their own discretion. The recommended pattern is to keep the main event loop sequential and use Go's concurrency primitives for any parallel tasks.