X11: Fix previous error handler not being restored

GLFW did not restore the previous Xlib error handler when removing its
own, instead resetting to the default handler.

This commit saves and restores the previous error handler.

None of this is thread-safe or could ever be.

Fixes #2108
This commit is contained in:
Camilla Löwy
2022-05-25 19:43:55 +02:00
parent 736a88b067
commit 26920a1a38
3 changed files with 8 additions and 2 deletions
+2
View File
@@ -567,6 +567,8 @@ typedef struct _GLFWlibraryX11
XContext context;
// XIM input method
XIM im;
// The previous X error handler, to be restored later
XErrorHandler errorHandler;
// Most recent error code received by X error handler
int errorCode;
// Primary selection string (while the primary selection is owned)