Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use ctypes instead of PyOpenGL for QtWebEngine Nvidia workaround
Fixes #2821
  • Loading branch information
The-Compiler committed Jul 27, 2017
1 parent 210bc0f commit a942613
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.asciidoc
Expand Up @@ -28,6 +28,8 @@ Breaking changes
- New dependency on ruamel.yaml; dropped PyYAML dependency.
- The QtWebEngine backend is now used by default if available.
- New config system which ignores the old config file.
- The depedency on PyOpenGL (when using QtWebEngine) got removed. Note
that PyQt5.QtOpenGL is still a depdency.
Major changes
~~~~~~~~~~~~~
Expand Down
1 change: 0 additions & 1 deletion README.asciidoc
Expand Up @@ -118,7 +118,6 @@ The following software and libraries are required to run qutebrowser:
* http://jinja.pocoo.org/[jinja2]
* http://pygments.org/[pygments]
* http://pyyaml.org/wiki/PyYAML[PyYAML]
* http://pyopengl.sourceforge.net/[PyOpenGL] when using QtWebEngine
The following libraries are optional:

Expand Down
8 changes: 8 additions & 0 deletions qutebrowser/browser/webengine/webenginesettings.py
Expand Up @@ -28,6 +28,9 @@
"""

import os
import sys
import ctypes
import ctypes.util

from PyQt5.QtGui import QFont
from PyQt5.QtWebEngineWidgets import (QWebEngineSettings, QWebEngineProfile,
Expand Down Expand Up @@ -199,6 +202,11 @@ def init(args):
if args.enable_webengine_inspector:
os.environ['QTWEBENGINE_REMOTE_DEBUGGING'] = str(utils.random_port())

# WORKAROUND for
# https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/941826
if sys.platform == 'linux':
ctypes.CDLL(ctypes.util.find_library("GL"), mode=ctypes.RTLD_GLOBAL)

_init_profiles()

# We need to do this here as a WORKAROUND for
Expand Down
6 changes: 0 additions & 6 deletions qutebrowser/misc/earlyinit.py
Expand Up @@ -344,12 +344,6 @@ def check_libraries(backend):
modules['PyQt5.QtWebEngineWidgets'] = _missing_str("QtWebEngine",
webengine=True)
modules['PyQt5.QtOpenGL'] = _missing_str("PyQt5.QtOpenGL")
# Workaround for a black screen with some setups
# https://github.com/spyder-ide/spyder/issues/3226
if not os.environ.get('QUTE_NO_OPENGL_WORKAROUND'):
# Hide "No OpenGL_accelerate module loaded: ..." message
logging.getLogger('OpenGL.acceleratesupport').propagate = False
modules['OpenGL.GL'] = _missing_str("PyOpenGL")
else:
assert backend == 'webkit'
modules['PyQt5.QtWebKit'] = _missing_str("PyQt5.QtWebKit")
Expand Down
1 change: 0 additions & 1 deletion qutebrowser/utils/version.py
Expand Up @@ -186,7 +186,6 @@ def _module_versions():
('yaml', ['__version__']),
('cssutils', ['__version__']),
('typing', []),
('OpenGL', ['__version__']),
('PyQt5.QtWebEngineWidgets', []),
('PyQt5.QtWebKitWidgets', []),
])
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Expand Up @@ -7,4 +7,3 @@ MarkupSafe==1.0
Pygments==2.2.0
pyPEG2==2.15.2
PyYAML==3.12
PyOpenGL==3.1.0
1 change: 0 additions & 1 deletion tests/unit/utils/test_version.py
Expand Up @@ -495,7 +495,6 @@ def __init__(self):
('yaml', True),
('cssutils', True),
('typing', True),
('OpenGL', True),
('PyQt5.QtWebEngineWidgets', True),
('PyQt5.QtWebKitWidgets', True),
])
Expand Down

0 comments on commit a942613

Please sign in to comment.