From 69e10b88b0a62542fe2324290637d76c565382f9 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 11 Feb 2014 15:46:54 +0100 Subject: [PATCH] Fixed uncaught BadWindow in EWMH check. Fixes #234. --- README.md | 2 ++ src/x11_init.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 1056e140..80bc5c8d 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,8 @@ The following dependencies are needed by the examples and test programs: - [X11] Bugfix: The case of finding no usable CRTCs was not detected - [X11] Bugfix: Detection of broken Nvidia RandR gamma support did not verify that at least one CRTC was present + - [X11] Bugfix: A stale `_NET_SUPPORTING_WM_CHECK` root window property would + cause an uncaught `BadWindow` error ## Contact diff --git a/src/x11_init.c b/src/x11_init.c index 1f029791..84ecbf52 100644 --- a/src/x11_init.c +++ b/src/x11_init.c @@ -359,6 +359,8 @@ static void detectEWMH(void) return; } + _glfwGrabXErrorHandler(); + // It should be the ID of a child window (of the root) // Then we look for the same property on the child window if (_glfwGetWindowProperty(*windowFromRoot, @@ -371,6 +373,10 @@ static void detectEWMH(void) return; } + _glfwReleaseXErrorHandler(); + if (_glfw.x11.errorCode != Success) + return; + // It should be the ID of that same child window if (*windowFromRoot != *windowFromChild) {