From a31a4dc5f7f98e4bb4b3b45ad7d06a2961171767 Mon Sep 17 00:00:00 2001 From: reuk Date: Wed, 17 Feb 2021 19:11:45 +0000 Subject: [PATCH] X11: Ensure repainting still works after destorying a GL context On Linux, repaints are only issued if the number of received SHM completion events matches the number of events initiated with `xShmPutImage`. Previously, destroying a GL context was calling `XSync (display, True)` which cleared the event queue. Sometimes, this would cause an 'SHM Completion Event' to be removed from the queue. This meant that the number of received events would never match the number of initiated events, and repainting would stop indefinitely. By calling `XSync (display, False)` instead, we ensure that pending events are kept in the queue, so any pending SHM completion event will be found as usual during the next repaint timer callback. --- modules/juce_opengl/native/juce_OpenGL_linux_X11.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/juce_opengl/native/juce_OpenGL_linux_X11.h b/modules/juce_opengl/native/juce_OpenGL_linux_X11.h index c33018466e2a..ef7eb852ed94 100644 --- a/modules/juce_opengl/native/juce_OpenGL_linux_X11.h +++ b/modules/juce_opengl/native/juce_OpenGL_linux_X11.h @@ -135,7 +135,7 @@ class OpenGLContext::NativeContext XWindowSystemUtilities::ScopedXLock xLock; X11Symbols::getInstance()->xUnmapWindow (display, embeddedWindow); X11Symbols::getInstance()->xDestroyWindow (display, embeddedWindow); - X11Symbols::getInstance()->xSync (display, True); + X11Symbols::getInstance()->xSync (display, False); } }