- /* If we are using Xft, check dpi value in X resources.
- It is better we use it as well, since Xft will use it, as will all
- Gnome applications. If our real DPI is smaller or larger than the
- one Xft uses, our font will look smaller or larger than other
- for other applications, even if it is the same font name (monospace-10
- for example). */
- char *v = XGetDefault (dpyinfo->display, "Xft", "dpi");
+ /* If we are using Xft, the following precautions should be made:
+
+ 1. Make sure that the Xrender extension is added before the Xft one.
+ Otherwise, the close-display hook set by Xft is called after the one
+ for Xrender, and the former tries to re-add the latter. This results
+ in inconsistency of internal states and leads to X protocol error when
+ one reconnects to the same X server (Bug#1696).
+
+ 2. Check dpi value in X resources. It is better we use it as well,
+ since Xft will use it, as will all Gnome applications. If our real DPI
+ is smaller or larger than the one Xft uses, our font will look smaller
+ or larger than other for other applications, even if it is the same
+ font name (monospace-10 for example). */
+
+ int event_base, error_base;
+ char *v;