* configure.ac: If using X11, check for XCB libraries and header.
* src/Makefile.in (XCB_LIBS): Define.
(LIBX_EXTRA): Include it.
* src/xterm.h [USE_XCB]: Include X11/Xlib-xcb.h.
(struct x_display_info) [USE_XCB]: Add an XCB connection handle field.
* src/xterm.c (x_term_init) [USE_XCB]: Initialize the new field.
fi
fi
+if test "${HAVE_X11}" = "yes"; then
+ AC_CHECK_HEADER(X11/Xlib-xcb.h,
+ AC_CHECK_LIB(xcb, xcb_translate_coordinates, HAVE_XCB=yes))
+ if test "${HAVE_XCB}" = "yes"; then
+ AC_CHECK_LIB(X11-xcb, XGetXCBConnection, HAVE_X11_XCB=yes)
+ if test "${HAVE_X11_XCB}" = "yes"; then
+ AC_DEFINE(USE_XCB, 1,
+[Define to 1 if you have the XCB library and X11-XCB library for mixed
+ X11/XCB programming.])
+ XCB_LIBS="-lX11-xcb -lxcb"
+ AC_SUBST(XCB_LIBS)
+ fi
+ fi
+fi
+
### Use -lXpm if available, unless '--with-xpm=no'.
### mingw32 doesn't use -lXpm, since it loads the library dynamically.
### In the Cygwin-w32 build, we need to use /usr/include/noX/X11/xpm.h
LIBIMAGE=@LIBTIFF@ @LIBJPEG@ @LIBPNG@ @LIBGIF@ @LIBXPM@
+XCB_LIBS=@XCB_LIBS@
XFT_LIBS=@XFT_LIBS@
-LIBX_EXTRA=-lX11 $(XFT_LIBS)
+LIBX_EXTRA=-lX11 $(XCB_LIBS) $(XFT_LIBS)
FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
struct terminal *terminal;
struct x_display_info *dpyinfo;
XrmDatabase xrdb;
+#ifdef USE_XCB
+ xcb_connection_t *xcb_conn;
+#endif
block_input ();
return 0;
}
+#ifdef USE_XCB
+ xcb_conn = XGetXCBConnection (dpy);
+ if (xcb_conn == 0)
+ {
+#ifdef USE_GTK
+ xg_display_close (dpy);
+#else
+#ifdef USE_X_TOOLKIT
+ XtCloseDisplay (dpy);
+#else
+ XCloseDisplay (dpy);
+#endif
+#endif /* ! USE_GTK */
+
+ unblock_input ();
+ return 0;
+ }
+#endif
+
/* We have definitely succeeded. Record the new connection. */
dpyinfo = xzalloc (sizeof *dpyinfo);
dpyinfo->name_list_element = Fcons (display_name, Qnil);
dpyinfo->display = dpy;
dpyinfo->connection = ConnectionNumber (dpyinfo->display);
+#ifdef USE_XCB
+ dpyinfo->xcb_connection = xcb_conn;
+#endif
/* http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg00194.html */
dpyinfo->smallest_font_height = 1;
#include <X11/Xlocale.h>
#endif
+#ifdef USE_XCB
+#include <X11/Xlib-xcb.h>
+#endif
+
#include "dispextern.h"
#include "termhooks.h"
#ifdef USE_CAIRO
XExtCodes *ext_codes;
#endif
+
+#ifdef USE_XCB
+ xcb_connection_t *xcb_connection;
+#endif
};
#ifdef HAVE_X_I18N