mirror of
https://github.com/brl/mutter.git
synced 2025-01-10 19:52:25 +00:00
winsys-glx: Add error traps in create_context
Both create_gl3_context and glXCreateNewContext can fail with an X error. https://bugzilla.gnome.org/show_bug.cgi?id=742678
This commit is contained in:
parent
853a9b6e49
commit
4f8254f1ae
@ -1075,6 +1075,8 @@ create_context (CoglDisplay *display, CoglError **error)
|
||||
COGL_NOTE (WINSYS, "Creating GLX Context (display: %p)",
|
||||
xlib_renderer->xdpy);
|
||||
|
||||
_cogl_xlib_renderer_trap_errors (display->renderer, &old_state);
|
||||
|
||||
if (display->renderer->driver == COGL_DRIVER_GL3)
|
||||
glx_display->glx_context = create_gl3_context (display, config);
|
||||
else
|
||||
@ -1085,7 +1087,8 @@ create_context (CoglDisplay *display, CoglError **error)
|
||||
NULL,
|
||||
True);
|
||||
|
||||
if (glx_display->glx_context == NULL)
|
||||
if (_cogl_xlib_renderer_untrap_errors (display->renderer, &old_state) ||
|
||||
glx_display->glx_context == NULL)
|
||||
{
|
||||
_cogl_set_error (error, COGL_WINSYS_ERROR,
|
||||
COGL_WINSYS_ERROR_CREATE_CONTEXT,
|
||||
|
Loading…
Reference in New Issue
Block a user