diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-03-16 21:11:39 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-03-16 21:11:39 +0000 |
| commit | f8a47de5ec444c452093371e3db16857eb39a490 (patch) | |
| tree | 31db2567842d98232775f9980f7a8d2586c0ac71 /c/xerror.c | |
| parent | 8ba0586bcbdc7fe9648f1063812126d71a041670 (diff) | |
merge the C branch into HEAD
Diffstat (limited to 'c/xerror.c')
| -rw-r--r-- | c/xerror.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/c/xerror.c b/c/xerror.c new file mode 100644 index 00000000..49a795f8 --- /dev/null +++ b/c/xerror.c @@ -0,0 +1,32 @@ +#include "openbox.h" +#include <glib.h> +#include <X11/Xlib.h> + +static gboolean xerror_ignore = FALSE; + +int xerror_handler(Display *d, XErrorEvent *e) +{ +#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; +} |
