all repos — openbox @ 5a24f4c1c6e46df5da4a52684bd75445f6450aed

openbox fork - make it a bit more like ryudo

openbox/xerror.c (raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "openbox.h"
#include <glib.h>
#include <X11/Xlib.h>

static gboolean xerror_ignore = FALSE;
gboolean xerror_occured = FALSE;

int xerror_handler(Display *d, XErrorEvent *e)
{
    xerror_occured = TRUE;
#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)
		/*g_warning("X Error: %s", errtxt)*/;
	    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;
}