Browse Source

Fix swap interval checking

Checking for the existence of the call only validated that our header
defined the value, not that the video card/driver supported the call.
We query the extensions string directly to check for support.  This
should fix both the X11 and virtualization issues (potentially other
crashes with older video cards as well)

Fixes https://gitlab.com/kicad/code/kicad/issues/8944
6.0.7
Seth Hillbrand 4 years ago
parent
commit
7c9340f855
  1. 8
      include/gl_utils.h

8
include/gl_utils.h

@ -25,6 +25,7 @@
#define GL_UTILS_H
#include <gal/opengl/kiglew.h> // Must be included first
#include <wx/glcanvas.h>
#include <wx/utils.h>
#include <limits>
@ -44,11 +45,6 @@ public:
/// Windows would include <wglext.h> and call wglSwapIntervalEXT
#if defined( __linux__ ) && !defined( KICAD_USE_EGL )
/// Do not try to set the swapping over remote connections
/// Video drivers lie and then crash when they can't handle the adaptive swapping
if( wxGetEnv( wxT( "SSH_CONNECTION"), nullptr ) )
return 0;
Display *dpy = glXGetCurrentDisplay();
GLXDrawable drawable = glXGetCurrentDrawable();
@ -56,7 +52,7 @@ public:
{
if( aVal < 0 )
{
if( !GLX_EXT_swap_control_tear )
if( !wxGLCanvas::IsExtensionSupported( "GLX_EXT_swap_control_tear" ) )
{
aVal = 0;
}

Loading…
Cancel
Save