mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-14 13:07:54 +00:00
[client] x11: catch and print details of X11 errors with a backtrace
This commit is contained in:
parent
188f25c6bf
commit
6f8e6f9a19
1 changed files with 19 additions and 0 deletions
|
@ -242,12 +242,31 @@ out:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int x11ErrorHandler(Display * display, XErrorEvent * error)
|
||||||
|
{
|
||||||
|
char errorText[1024];
|
||||||
|
XGetErrorText(display, error->error_code, errorText, sizeof(errorText));
|
||||||
|
|
||||||
|
DEBUG_ERROR("X11 Error: %s", errorText);
|
||||||
|
DEBUG_PRINT_BACKTRACE();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int x11IOErrorHandler(Display * display)
|
||||||
|
{
|
||||||
|
DEBUG_FATAL("Fatal X11 IO Error");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static bool x11Init(const LG_DSInitParams params)
|
static bool x11Init(const LG_DSInitParams params)
|
||||||
{
|
{
|
||||||
XIDeviceInfo *devinfo;
|
XIDeviceInfo *devinfo;
|
||||||
int count;
|
int count;
|
||||||
int event, error;
|
int event, error;
|
||||||
|
|
||||||
|
XSetErrorHandler(x11ErrorHandler);
|
||||||
|
XSetIOErrorHandler(x11IOErrorHandler);
|
||||||
|
|
||||||
memset(&x11, 0, sizeof(x11));
|
memset(&x11, 0, sizeof(x11));
|
||||||
x11.xValuator = -1;
|
x11.xValuator = -1;
|
||||||
x11.yValuator = -1;
|
x11.yValuator = -1;
|
||||||
|
|
Loading…
Reference in a new issue