1 /* Copyright (c) 1994-1996 David Hogan, see README for licence details */
7 #include <X11/Xproto.h>
16 fprintf(stderr, "rio: ");
18 fprintf(stderr, "\n");
23 handler(Display *d, XErrorEvent *e)
25 char msg[80], req[80], number[80];
27 if(initting && (e->request_code == X_ChangeWindowAttributes) && (e->error_code == BadAccess)){
28 fprintf(stderr, "rio: it looks like there's already a window manager running; rio not started\n");
32 if(ignore_badwindow && (e->error_code == BadWindow || e->error_code == BadColor))
35 XGetErrorText(d, e->error_code, msg, sizeof(msg));
36 sprintf(number, "%d", e->request_code);
37 XGetErrorDatabaseText(d, "XRequest", number, "", req, sizeof(req));
39 sprintf(req, "<request-code-%d>", (int)e->request_code);
41 fprintf(stderr, "rio: %s(0x%x): %s\n", req, (int)e->resourceid, msg);
44 fprintf(stderr, "rio: failure during initialisation; aborting\n");
51 graberror(char *f, int err)
53 #ifdef DEBUG /* sick of "bug" reports; grab errors "just happen" */
61 s = "already grabbed";
72 fprintf(stderr, "rio: %s: grab error: %d\n", f, err);
75 fprintf(stderr, "rio: %s: grab error: %s\n", f, s);
80 #include "showevent/ShowEvent.c"
86 dotrace(char *s, Client *c, XEvent *e)
90 fprintf(stderr, "rio: %s: c=%p", s, c);
92 fprintf(stderr, " x %d y %d dx %d dy %d w 0x%x parent 0x%x", c->x, c->y, c->dx, c->dy, (uint)c->window, (uint)c->parent);
95 fprintf(stderr, "\n\t");
99 fprintf(stderr, "\n");