Skip to content

Commit

Permalink
Fix broken X11 override and detection
Browse files Browse the repository at this point in the history
  • Loading branch information
einarf committed Feb 16, 2021
1 parent 4c50140 commit ebd996a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions glcontext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,12 @@ def create(*args, **kwargs):
if not kwargs.get('libgl'):
kwargs['libgl'] = find_library('GL')

libx11 = find_library("X11")
if not libx11:
raise SystemError("Cannot find the X11 library")
if not kwargs.get('libx11'):
kwargs['libx11'] = find_library("X11")

_apply_env_var(kwargs, 'glversion', 'GLCONTEXT_GLVERSION', arg_type=int)
_apply_env_var(kwargs, 'libgl', 'GLCONTEXT_LINUX_LIBGL')
_apply_env_var(kwargs, libx11, 'GLCONTEXT_LINUX_LIBX11')
_apply_env_var(kwargs, 'libx11', 'GLCONTEXT_LINUX_LIBX11')
kwargs = _strip_kwargs(kwargs, ['glversion', 'mode', 'libgl', 'libx11'])
return x11.create_context(**kwargs)

Expand Down Expand Up @@ -134,3 +133,4 @@ def _apply_env_var(kwargs, arg_name, env_name, arg_type=str):
value = os.environ.get(env_name, kwargs.get(arg_name))
if value:
kwargs[arg_name] = arg_type(value)

0 comments on commit ebd996a

Please sign in to comment.