mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-22 13:33:40 +00:00
[client] x11: catch and print details of X11 errors with a backtrace
This commit is contained in:
parent
188f25c6bf
commit
6f8e6f9a19
@ -242,12 +242,31 @@ out:
|
||||
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)
|
||||
{
|
||||
XIDeviceInfo *devinfo;
|
||||
int count;
|
||||
int event, error;
|
||||
|
||||
XSetErrorHandler(x11ErrorHandler);
|
||||
XSetIOErrorHandler(x11IOErrorHandler);
|
||||
|
||||
memset(&x11, 0, sizeof(x11));
|
||||
x11.xValuator = -1;
|
||||
x11.yValuator = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user