diff -upr mesa-17.0.4.orig/src/glx/dri2_glx.c mesa-17.0.4/src/glx/dri2_glx.c --- mesa-17.0.4.orig/src/glx/dri2_glx.c 2017-04-17 15:38:57.016936032 +0200 +++ mesa-17.0.4/src/glx/dri2_glx.c 2017-04-19 22:15:23.094547639 +0200 @@ -635,6 +635,12 @@ dri2_copy_drawable(struct dri2_drawable static void dri2_wait_x(struct glx_context *gc) { + // src: https://bugs.freedesktop.org/show_bug.cgi?id=90264#c45 + if (gc->currentDpy != NULL) { + //dri2InvalidateBuffers(gc->currentDpy, gc->currentDrawable); // doesn't work with only this! + XSync(gc->currentDpy, False);//works with only this, when dri3 is disabled! + } + struct dri2_drawable *priv = (struct dri2_drawable *) GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable); diff -upr mesa-17.0.4.orig/src/glx/dri3_glx.c mesa-17.0.4/src/glx/dri3_glx.c --- mesa-17.0.4.orig/src/glx/dri3_glx.c 2017-04-17 15:38:57.016936032 +0200 +++ mesa-17.0.4/src/glx/dri3_glx.c 2017-04-19 22:22:34.822120088 +0200 @@ -453,6 +453,12 @@ dri3_copy_sub_buffer(__GLXDRIdrawable *p static void dri3_wait_x(struct glx_context *gc) { + // src: https://bugs.freedesktop.org/show_bug.cgi?id=90264#c50 + if (gc->currentDpy != NULL) { + //dri2InvalidateBuffers(gc->currentDpy, gc->currentDrawable); //can't find equivalent of this for dri3, doesn't matter anyway since the dri2 one doesn't even work for dri2! + //XSync(gc->currentDpy, False);//no effect when dri3 is enabled + } + struct dri3_drawable *priv = (struct dri3_drawable *) GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);