Tweak error handler API.
This commit is contained in:
parent
248ec63e1e
commit
9cc77c09c3
|
@ -380,9 +380,9 @@ EventsGetExtensionName(int req)
|
|||
}
|
||||
|
||||
void
|
||||
EventShowError(const XErrorEvent * ev)
|
||||
EventShowError(const XEvent * evp)
|
||||
{
|
||||
Display *dpy = disp;
|
||||
const XErrorEvent *ev = &evp->xerror;
|
||||
char buf[64], buf1[64];
|
||||
|
||||
if (ev->request_code < 128)
|
||||
|
@ -390,8 +390,8 @@ EventShowError(const XErrorEvent * ev)
|
|||
else
|
||||
Esnprintf(buf, sizeof(buf), "%s.%d",
|
||||
EventsGetExtensionName(ev->request_code), ev->minor_code);
|
||||
XGetErrorDatabaseText(dpy, "XRequest", buf, "", buf1, sizeof(buf1));
|
||||
XGetErrorText(dpy, ev->error_code, buf, sizeof(buf));
|
||||
XGetErrorDatabaseText(disp, "XRequest", buf, "", buf1, sizeof(buf1));
|
||||
XGetErrorText(disp, ev->error_code, buf, sizeof(buf));
|
||||
Eprintf("*** ERROR: xid=%#lx req=%i/%i err=%i: %s: %s\n",
|
||||
ev->resourceid, ev->request_code, ev->minor_code,
|
||||
ev->error_code, buf1, buf);
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
void EventsInit(void);
|
||||
void EventsMain(void);
|
||||
void EventShow(const XEvent * ev);
|
||||
void EventShowError(const XErrorEvent * ev);
|
||||
void EventShowError(const XEvent * ev);
|
||||
|
||||
typedef struct _EventFdDesc EventFdDesc;
|
||||
typedef void (EventFdHandler) (void);
|
||||
|
|
2
src/x.c
2
src/x.c
|
@ -1794,7 +1794,7 @@ static int
|
|||
_HandleXError(Display * dpy __UNUSED__, XErrorEvent * ev)
|
||||
{
|
||||
if (EDebug(1) && EXErrorFunc)
|
||||
EXErrorFunc(ev);
|
||||
EXErrorFunc((XEvent *) ev);
|
||||
|
||||
Dpy.last_error_code = ev->error_code;
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ int EDisplayOpen(const char *dstr, int scr);
|
|||
void EDisplayClose(void);
|
||||
void EDisplayDisconnect(void);
|
||||
|
||||
typedef void (EXErrorHandler) (const XErrorEvent *);
|
||||
typedef void (EXErrorHandler) (const XEvent *);
|
||||
typedef void (EXIOErrorHandler) (void);
|
||||
void EDisplaySetErrorHandlers(EXErrorHandler * error,
|
||||
EXIOErrorHandler * fatal);
|
||||
|
|
Loading…
Reference in New Issue