11.8.1 Enabling or Disabling Synchronization

When debugging X applications, it often is very convenient to require Xlib to behave synchronously so that errors are reported as they occur. The following function lets you disable or enable synchronous behavior. Note that graphics may occur 30 or more times more slowly when synchronization is enabled. On POSIX-conformant systems, there is also a global variable _Xdebug that, if set to nonzero before starting a program under a debugger, will force synchronous library behavior.

After completing their work, all Xlib functions that generate protocol requests call what is known as an after function. XSetAfterFunction() sets which function is to be called.

To enable or disable synchronization, use XSynchronize().

Next: Using the Default Error Handlers

Christophe Tronche, ch@tronche.com