Commit d8ecbe56 authored by Dave Airlie's avatar Dave Airlie Committed by Eric Anholt

ephyr: catch X errors if we try to create a core context and fail.

This stops Xephyr failing on GLXBadFBConfig.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
parent 50ca286d
......@@ -280,9 +280,16 @@ ephyr_glamor_process_event(xcb_generic_event_t *xev)
XUnlockDisplay(dpy);
}
static int
ephyr_glx_error_handler(Display * _dpy, XErrorEvent * ev)
{
return 0;
}
struct ephyr_glamor *
ephyr_glamor_glx_screen_init(xcb_window_t win)
{
int (*oldErrorHandler) (Display *, XErrorEvent *);
static const float position[] = {
-1, -1,
1, -1,
......@@ -332,8 +339,11 @@ ephyr_glamor_glx_screen_init(xcb_window_t win)
GLAMOR_GL_CORE_VER_MINOR,
0,
};
oldErrorHandler = XSetErrorHandler(ephyr_glx_error_handler);
ctx = glXCreateContextAttribsARB(dpy, fb_config, NULL, True,
context_attribs);
XSync(dpy, False);
XSetErrorHandler(oldErrorHandler);
if (!ctx)
ctx = glXCreateContext(dpy, visual_info, NULL, True);
}
......
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