summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte.benjamin@googlemail.com>2022-12-02 15:32:22 +0000
committerBenjamin Otte <otte.benjamin@googlemail.com>2022-12-02 15:32:22 +0000
commita9c9678e1f617755368f16424a03ae1f2d2ced4e (patch)
treed0df04bfdb5f05ee65b695f577702f71687f0a75
parentc977f5cbb0c4778e457e474aaecbe0d34608a7f4 (diff)
parentf788e994a99205a8cd32d64f3d70326da3436565 (diff)
downloadgtk+-a9c9678e1f617755368f16424a03ae1f2d2ced4e.tar.gz
Merge branch 'workaround-glx-issue' into 'main'
GLX: Add extra glXMakeContextCurrent () call to work around a DRI issue Closes #4499, #5387, and #5170 See merge request GNOME/gtk!5285
-rw-r--r--gdk/x11/gdkglcontext-glx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdk/x11/gdkglcontext-glx.c b/gdk/x11/gdkglcontext-glx.c
index 229fe4afaf..6be6eb7e16 100644
--- a/gdk/x11/gdkglcontext-glx.c
+++ b/gdk/x11/gdkglcontext-glx.c
@@ -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;