Skip to content

Commit

Permalink
#3483 numpy can be imported when making gl calls
Browse files Browse the repository at this point in the history
not just when importing these calls..
  • Loading branch information
totaam committed Feb 14, 2024
1 parent 933917d commit 06bba8c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions xpra/client/gl/gl_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ def get_max_texture_size() -> int:


def check_PyOpenGL_support(force_enable) -> Dict[str,Any]:
from xpra.util import numpy_import_lock
with numpy_import_lock:
return do_check_PyOpenGL_support(force_enable)

def do_check_PyOpenGL_support(force_enable) -> Dict[str,Any]:
props : Dict[str,Any] = {
"platform" : sys.platform,
}
Expand All @@ -110,11 +115,10 @@ def unsafe():
redirected_loggers[name] = (logger, list(logger.handlers), logger.propagate)
logger.handlers = [CaptureHandler()]
logger.propagate = False
with numpy_import_lock:
import OpenGL
props["pyopengl"] = OpenGL.__version__ # @UndefinedVariable
from OpenGL.GL import GL_VERSION, GL_EXTENSIONS
from OpenGL.GL import glGetString, glGetIntegerv
import OpenGL
props["pyopengl"] = OpenGL.__version__ # @UndefinedVariable
from OpenGL.GL import GL_VERSION, GL_EXTENSIONS
from OpenGL.GL import glGetString, glGetIntegerv
gl_version_str = glGetString(GL_VERSION)
if gl_version_str is None and not force_enable:
raise_fatal_error("OpenGL version is missing - cannot continue")
Expand Down

0 comments on commit 06bba8c

Please sign in to comment.