Merge branch 'wip/fencing-without-context-is-discouraged' into 'master'

x11: ensure some context is bound before calling glClientWaitSync

See merge request GNOME/gtk!2138
This commit is contained in:
Matthias Clasen 2020-06-22 23:01:11 +00:00
commit 1643e81c47

View File

@ -606,6 +606,14 @@ on_gl_surface_xevent (GdkGLContext *context,
{
GLenum wait_result;
/* We don't care if the passed context is the current context,
* necessarily, but we do care that *some* context is bound,
* otherwise, the GL dispatch layer will make glClientWaitSync()
* silently return 0.
*/
if (glXGetCurrentContext () == NULL)
gdk_gl_context_make_current (context);
wait_result = glClientWaitSync (context_x11->frame_fence, 0, 0);
switch (wait_result)