Skip to content

Commit

Permalink
Remove X11 error handler
Browse files Browse the repository at this point in the history
And with it the only direct X11 dependency.
  • Loading branch information
jralls committed Oct 31, 2017
1 parent f05761e commit 49c7079
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 48 deletions.
4 changes: 0 additions & 4 deletions CMakeLists.txt
Expand Up @@ -581,10 +581,6 @@ ENDIF ()
SET (HAVE_HTMLHELPW 1)
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 (dlfcn.h HAVE_DLFCN_H)
CHECK_INCLUDE_FILES (glob.h HAVE_GLOB_H)
Expand Down
3 changes: 0 additions & 3 deletions common/config.h.cmake.in
Expand Up @@ -264,9 +264,6 @@
/* Define to 1 if you have the <wctype.h> header file. */
#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'. */
#cmakedefine HAVE__USR_INCLUDE_GMOCK_GMOCK_H

Expand Down
11 changes: 3 additions & 8 deletions configure.ac
Expand Up @@ -486,15 +486,10 @@ AM_CONDITIONAL(PLATFORM_OSX_QUARTZ, test "x$platform" = "xdarwin/quartz")
AM_CONDITIONAL(PLATFORM_WIN32, test "x$platform" = "xwin32")
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
if test "x$_gdk_tgt" = xquartz;
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_HEADERS(glob.h)

AC_CHECK_FUNCS(chown gethostname getppid getuid gettimeofday gmtime_r)
AC_CHECK_FUNCS(gethostid link)
##################################################
Expand Down
4 changes: 0 additions & 4 deletions gnucash/gnome-utils/Makefile.am
Expand Up @@ -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
$(XSLTPROC) -o $@ $(srcdir)/make-gnc-warnings-h.xsl $<

if HAVE_X11_XLIB_H
libgncmod_gnome_utils_la_LIBADD += -lX11
endif

if BUILDING_FROM_VCS
swig-gnome-utils.c: gnome-utils.i \
${top_srcdir}/common/base-typemaps.i
Expand Down
29 changes: 0 additions & 29 deletions gnucash/gnome-utils/gnc-gnome-utils.c
Expand Up @@ -24,9 +24,6 @@
#include <config.h>

#include <glib/gi18n.h>
#ifdef HAVE_X11_XLIB_H
# include <X11/Xlib.h>
#endif
#include <libxml/xmlIO.h>

#include "gnc-prefs-utils.h"
Expand Down Expand Up @@ -640,28 +637,6 @@ gnc_ui_check_events (gpointer not_used)
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
gnc_ui_start_event_loop (void)
Expand All @@ -673,10 +648,6 @@ gnc_ui_start_event_loop (void)
id = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, 10000, /* 10 secs */
gnc_ui_check_events, NULL, NULL);

#ifdef HAVE_X11_XLIB_H
XSetErrorHandler (gnc_x_error);
#endif

/* Enter gnome event loop */
gtk_main ();

Expand Down

0 comments on commit 49c7079

Please sign in to comment.