Setup an X IO error handler
The default erro handler calls exit(), which doesn't work well when multiple threads are involved. Closes: https://github.com/Plagman/gamescope/issues/46
This commit is contained in:
parent
9d6b37ee22
commit
f268c17fb1
1 changed files with 8 additions and 0 deletions
|
@ -2233,6 +2233,13 @@ error (Display *dpy, XErrorEvent *ev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
handle_io_error(Display *dpy)
|
||||
{
|
||||
fprintf(stderr, "X11 I/O error\n");
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
static Bool
|
||||
register_cm (Display *dpy)
|
||||
{
|
||||
|
@ -2503,6 +2510,7 @@ steamcompmgr_main (int argc, char **argv)
|
|||
exit (1);
|
||||
}
|
||||
XSetErrorHandler (error);
|
||||
XSetIOErrorHandler (handle_io_error);
|
||||
if (synchronize)
|
||||
XSynchronize (dpy, 1);
|
||||
scr = DefaultScreen (dpy);
|
||||
|
|
Loading…
Reference in a new issue