XGrabServer(), XUngrabServer() - grab the server
XGrabServer (Display *display)
XUngrabServer (Display *display)
The XGrabServer(3) function disables processing of requests and close downs on all other connections than the one this request arrived on. You should not grab the X server any more than is absolutely necessary.
The XUngrabServer(3) function restarts processing of requests and close downs on other connections. You should avoid grabbing the X server as much as possible.
XGrabKey()
Xlib