GLX: Add extra glXMakeContextCurrent () call to work around a DRI issue
Closes #4499, #5387, and #5170
See merge request GNOME/gtk!5285
(cherry picked from commit
a9c9678e1f617755368f16424a03ae1f2d2ced4e)
f788e994 GLX: Add extra glXMakeContextCurrent () call to work around a DRI issue
"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;