openbox/openbox/xerror.c

35 lines
649 B
C
Raw Normal View History

2003-03-16 21:11:39 +00:00
#include "openbox.h"
#include <glib.h>
#include <X11/Xlib.h>
static gboolean xerror_ignore = FALSE;
2003-03-29 00:48:52 +00:00
gboolean xerror_occured = FALSE;
2003-03-16 21:11:39 +00:00
int xerror_handler(Display *d, XErrorEvent *e)
{
2003-03-29 00:48:52 +00:00
xerror_occured = TRUE;
2003-03-16 21:11:39 +00:00
#ifdef DEBUG
if (!xerror_ignore) {
char errtxt[128];
/*if (e->error_code != BadWindow) */
{
XGetErrorText(d, e->error_code, errtxt, 127);
if (e->error_code == BadWindow)
2003-03-26 09:05:58 +00:00
/*g_warning("X Error: %s", errtxt)*/;
2003-03-16 21:11:39 +00:00
else
g_error("X Error: %s", errtxt);
}
}
#else
(void)d; (void)e;
#endif
return 0;
}
void xerror_set_ignore(gboolean ignore)
{
XSync(ob_display, FALSE);
xerror_ignore = ignore;
}