Commit f5207dea by Corentin Wallez Committed by Commit Bot

DisplayGLX: XSync before setting the error handler

This mirrors https://codereview.chromium.org/2206973002 BUG=628823 Change-Id: Ifd71d67df174cac3f90097c809fc91046699bed8 Reviewed-on: https://chromium-review.googlesource.com/366790Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
parent 43341b7a
...@@ -927,6 +927,9 @@ egl::Error DisplayGLX::createContextAttribs(glx::FBConfig, ...@@ -927,6 +927,9 @@ egl::Error DisplayGLX::createContextAttribs(glx::FBConfig,
// When creating a context with glXCreateContextAttribsARB, a variety of X11 errors can // When creating a context with glXCreateContextAttribsARB, a variety of X11 errors can
// be generated. To prevent these errors from crashing our process, we simply ignore // be generated. To prevent these errors from crashing our process, we simply ignore
// them and only look if GLXContext was created. // them and only look if GLXContext was created.
// Process all events before setting the error handler to avoid desynchronizing XCB instances
// (the error handler is NOT per-display).
XSync(mXDisplay, False);
auto oldErrorHandler = XSetErrorHandler(IgnoreX11Errors); auto oldErrorHandler = XSetErrorHandler(IgnoreX11Errors);
*context = mGLX.createContextAttribsARB(mContextConfig, nullptr, True, attribs.data()); *context = mGLX.createContextAttribsARB(mContextConfig, nullptr, True, attribs.data());
XSetErrorHandler(oldErrorHandler); XSetErrorHandler(oldErrorHandler);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment