Merge branch 'cherry-pick-a9c9678e' into 'gtk-4-8'

Merge branch 'workaround-glx-issue' into 'main'

See merge request GNOME/gtk!5287
This commit is contained in:
Benjamin Otte 2022-12-02 17:10:38 +00:00
commit 272e354d57

View File

@ -232,6 +232,12 @@ gdk_x11_gl_context_glx_make_current (GdkGLContext *context,
"Making GLX context %p current to drawable %lu",
context, (unsigned long) drawable);
/* Work around a glitch, see
* https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5281
*/
if (glXGetCurrentContext () != self->glx_context)
glXMakeContextCurrent (dpy, None, None, NULL);
if (!glXMakeContextCurrent (dpy, drawable, drawable, self->glx_context))
return FALSE;