Remove X11 error handler

And with it the only direct X11 dependency.
This commit is contained in:
John Ralls 2017-10-30 10:08:07 -07:00
parent f05761e636
commit 49c70795c3
5 changed files with 3 additions and 48 deletions

View File

@ -581,10 +581,6 @@ ENDIF ()
SET (HAVE_HTMLHELPW 1) SET (HAVE_HTMLHELPW 1)
ENDIF (WIN32) ENDIF (WIN32)
IF (NOT WIN32)
CHECK_INCLUDE_FILES (X11/Xlib.h HAVE_X11_XLIB_H)
ENDIF (NOT WIN32)
CHECK_INCLUDE_FILES (dirent.h HAVE_DIRENT_H) CHECK_INCLUDE_FILES (dirent.h HAVE_DIRENT_H)
CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H) CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H)
CHECK_INCLUDE_FILES (glob.h HAVE_GLOB_H) CHECK_INCLUDE_FILES (glob.h HAVE_GLOB_H)

View File

@ -264,9 +264,6 @@
/* Define to 1 if you have the <wctype.h> header file. */ /* Define to 1 if you have the <wctype.h> header file. */
#cmakedefine HAVE_WCTYPE_H 1 #cmakedefine HAVE_WCTYPE_H 1
/* Define to 1 if you have the <X11/Xlib.h> header file. */
#cmakedefine HAVE_X11_XLIB_H 1
/* Define to 1 if you have the file `/usr/include/gmock/gmock.h'. */ /* Define to 1 if you have the file `/usr/include/gmock/gmock.h'. */
#cmakedefine HAVE__USR_INCLUDE_GMOCK_GMOCK_H #cmakedefine HAVE__USR_INCLUDE_GMOCK_GMOCK_H

View File

@ -486,15 +486,10 @@ AM_CONDITIONAL(PLATFORM_OSX_QUARTZ, test "x$platform" = "xdarwin/quartz")
AM_CONDITIONAL(PLATFORM_WIN32, test "x$platform" = "xwin32") AM_CONDITIONAL(PLATFORM_WIN32, test "x$platform" = "xwin32")
AM_CONDITIONAL(OS_WIN32, test "x$native_win32" = "xyes") AM_CONDITIONAL(OS_WIN32, test "x$native_win32" = "xyes")
# These are unavailable on windows/mingw32 and X11 isn't desired or # These are unavailable on windows/mingw32
# required for MacOSX Quartz # required for MacOSX Quartz
if test "x$_gdk_tgt" = xquartz; AC_CHECK_HEADERS(glob.h)
then
AC_CHECK_HEADERS(glob.h)
else
AC_CHECK_HEADERS(X11/Xlib.h glob.h)
fi
AM_CONDITIONAL(HAVE_X11_XLIB_H, test "x$ac_cv_header_X11_Xlib_h" = "xyes")
AC_CHECK_FUNCS(chown gethostname getppid getuid gettimeofday gmtime_r) AC_CHECK_FUNCS(chown gethostname getppid getuid gettimeofday gmtime_r)
AC_CHECK_FUNCS(gethostid link) AC_CHECK_FUNCS(gethostid link)
################################################## ##################################################

View File

@ -217,10 +217,6 @@ gnc-warnings.c: gschemas/org.gnucash.warnings.gschema.xml.in make-gnc-warnings-c
gnc-warnings.h: gschemas/org.gnucash.warnings.gschema.xml.in make-gnc-warnings-h.xsl gnc-warnings.h: gschemas/org.gnucash.warnings.gschema.xml.in make-gnc-warnings-h.xsl
$(XSLTPROC) -o $@ $(srcdir)/make-gnc-warnings-h.xsl $< $(XSLTPROC) -o $@ $(srcdir)/make-gnc-warnings-h.xsl $<
if HAVE_X11_XLIB_H
libgncmod_gnome_utils_la_LIBADD += -lX11
endif
if BUILDING_FROM_VCS if BUILDING_FROM_VCS
swig-gnome-utils.c: gnome-utils.i \ swig-gnome-utils.c: gnome-utils.i \
${top_srcdir}/common/base-typemaps.i ${top_srcdir}/common/base-typemaps.i

View File

@ -24,9 +24,6 @@
#include <config.h> #include <config.h>
#include <glib/gi18n.h> #include <glib/gi18n.h>
#ifdef HAVE_X11_XLIB_H
# include <X11/Xlib.h>
#endif
#include <libxml/xmlIO.h> #include <libxml/xmlIO.h>
#include "gnc-prefs-utils.h" #include "gnc-prefs-utils.h"
@ -640,28 +637,6 @@ gnc_ui_check_events (gpointer not_used)
return TRUE; return TRUE;
} }
#ifdef HAVE_X11_XLIB_H
static int
gnc_x_error (Display *display, XErrorEvent *error)
{
if (error->error_code)
{
char buf[64];
XGetErrorText (display, error->error_code, buf, 63);
g_warning ("X-ERROR **: %s\n serial %ld error_code %d "
"request_code %d minor_code %d\n",
buf,
error->serial,
error->error_code,
error->request_code,
error->minor_code);
}
return 0;
}
#endif
int int
gnc_ui_start_event_loop (void) gnc_ui_start_event_loop (void)
@ -673,10 +648,6 @@ gnc_ui_start_event_loop (void)
id = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, 10000, /* 10 secs */ id = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, 10000, /* 10 secs */
gnc_ui_check_events, NULL, NULL); gnc_ui_check_events, NULL, NULL);
#ifdef HAVE_X11_XLIB_H
XSetErrorHandler (gnc_x_error);
#endif
/* Enter gnome event loop */ /* Enter gnome event loop */
gtk_main (); gtk_main ();