Make PyOpenGL a required dependency

Looks like the "black screen" issue isn't the only thing going wrong, some
people even report segfaults since the vendor check was added.
This commit is contained in:
Florian Bruhin 2017-06-20 13:05:53 +02:00
parent 73940a64bb
commit 750ef834dc
7 changed files with 11 additions and 12 deletions

View File

@ -23,8 +23,7 @@ New dependencies
- New dependency on `PyQt5.QtOpenGL` if QtWebEngine is used. QtWebEngine depends - New dependency on `PyQt5.QtOpenGL` if QtWebEngine is used. QtWebEngine depends
on QtOpenGL already, but on distributions packaging split PyQt5 wrappers, the on QtOpenGL already, but on distributions packaging split PyQt5 wrappers, the
wrappers for QtOpenGL are now required. wrappers for QtOpenGL are now required.
- New optional (but recommended) `PyOpenGL` dependency with QtWebEngine to work - New dependency on `PyOpenGL` if QtWebEngine is used.
around a bug where a black screen is shown with some setups.
Added Added
~~~~~ ~~~~~

View File

@ -108,6 +108,7 @@ The following software and libraries are required to run qutebrowser:
* http://jinja.pocoo.org/[jinja2] * http://jinja.pocoo.org/[jinja2]
* http://pygments.org/[pygments] * http://pygments.org/[pygments]
* http://pyyaml.org/wiki/PyYAML[PyYAML] * http://pyyaml.org/wiki/PyYAML[PyYAML]
* http://pyopengl.sourceforge.net/[PyOpenGL] when using QtWebEngine
The following libraries are optional and provide a better user experience: The following libraries are optional and provide a better user experience:

View File

@ -209,12 +209,7 @@ def init(args):
if not os.environ.get('QUTE_NO_OPENGL_WORKAROUND'): if not os.environ.get('QUTE_NO_OPENGL_WORKAROUND'):
# Hide "No OpenGL_accelerate module loaded: ..." message # Hide "No OpenGL_accelerate module loaded: ..." message
logging.getLogger('OpenGL.acceleratesupport').propagate = False logging.getLogger('OpenGL.acceleratesupport').propagate = False
try: from OpenGL import GL # pylint: disable=unused-variable
from OpenGL import GL # pylint: disable=unused-variable
except ImportError:
pass
else:
log.misc.debug("Imported PyOpenGL as workaround")
_init_profiles() _init_profiles()

View File

@ -341,6 +341,7 @@ def check_libraries(backend):
modules['PyQt5.QtWebEngineWidgets'] = _missing_str("QtWebEngine", modules['PyQt5.QtWebEngineWidgets'] = _missing_str("QtWebEngine",
webengine=True) webengine=True)
modules['PyQt5.QtOpenGL'] = _missing_str("PyQt5.QtOpenGL") modules['PyQt5.QtOpenGL'] = _missing_str("PyQt5.QtOpenGL")
modules['OpenGL'] = _missing_str("PyOpenGL")
else: else:
assert backend == 'webkit' assert backend == 'webkit'
modules['PyQt5.QtWebKit'] = _missing_str("PyQt5.QtWebKit") modules['PyQt5.QtWebKit'] = _missing_str("PyQt5.QtWebKit")

View File

@ -186,6 +186,7 @@ def _module_versions():
('yaml', ['__version__']), ('yaml', ['__version__']),
('cssutils', ['__version__']), ('cssutils', ['__version__']),
('typing', []), ('typing', []),
('OpenGL', ['__version__']),
('PyQt5.QtWebEngineWidgets', []), ('PyQt5.QtWebEngineWidgets', []),
('PyQt5.QtWebKitWidgets', []), ('PyQt5.QtWebKitWidgets', []),
]) ])

View File

@ -7,3 +7,4 @@ MarkupSafe==1.0
Pygments==2.2.0 Pygments==2.2.0
pyPEG2==2.15.2 pyPEG2==2.15.2
PyYAML==3.12 PyYAML==3.12
PyOpenGL==3.1.0

View File

@ -496,6 +496,7 @@ class ImportFake:
'typing': True, 'typing': True,
'PyQt5.QtWebEngineWidgets': True, 'PyQt5.QtWebEngineWidgets': True,
'PyQt5.QtWebKitWidgets': True, 'PyQt5.QtWebKitWidgets': True,
'OpenGL': True,
} }
self.version_attribute = '__version__' self.version_attribute = '__version__'
self.version = '1.2.3' self.version = '1.2.3'
@ -555,7 +556,7 @@ class TestModuleVersions:
"""Test with all modules present in version 1.2.3.""" """Test with all modules present in version 1.2.3."""
expected = ['sip: yes', 'colorama: 1.2.3', 'pypeg2: 1.2.3', expected = ['sip: yes', 'colorama: 1.2.3', 'pypeg2: 1.2.3',
'jinja2: 1.2.3', 'pygments: 1.2.3', 'yaml: 1.2.3', 'jinja2: 1.2.3', 'pygments: 1.2.3', 'yaml: 1.2.3',
'cssutils: 1.2.3', 'typing: yes', 'cssutils: 1.2.3', 'typing: yes', 'OpenGL: 1.2.3',
'PyQt5.QtWebEngineWidgets: yes', 'PyQt5.QtWebEngineWidgets: yes',
'PyQt5.QtWebKitWidgets: yes'] 'PyQt5.QtWebKitWidgets: yes']
assert version._module_versions() == expected assert version._module_versions() == expected
@ -579,17 +580,17 @@ class TestModuleVersions:
@pytest.mark.parametrize('value, expected', [ @pytest.mark.parametrize('value, expected', [
('VERSION', ['sip: yes', 'colorama: 1.2.3', 'pypeg2: yes', ('VERSION', ['sip: yes', 'colorama: 1.2.3', 'pypeg2: yes',
'jinja2: yes', 'pygments: yes', 'yaml: yes', 'jinja2: yes', 'pygments: yes', 'yaml: yes',
'cssutils: yes', 'typing: yes', 'cssutils: yes', 'typing: yes', 'OpenGL: yes',
'PyQt5.QtWebEngineWidgets: yes', 'PyQt5.QtWebEngineWidgets: yes',
'PyQt5.QtWebKitWidgets: yes']), 'PyQt5.QtWebKitWidgets: yes']),
('SIP_VERSION_STR', ['sip: 1.2.3', 'colorama: yes', 'pypeg2: yes', ('SIP_VERSION_STR', ['sip: 1.2.3', 'colorama: yes', 'pypeg2: yes',
'jinja2: yes', 'pygments: yes', 'yaml: yes', 'jinja2: yes', 'pygments: yes', 'yaml: yes',
'cssutils: yes', 'typing: yes', 'cssutils: yes', 'typing: yes', 'OpenGL: yes',
'PyQt5.QtWebEngineWidgets: yes', 'PyQt5.QtWebEngineWidgets: yes',
'PyQt5.QtWebKitWidgets: yes']), 'PyQt5.QtWebKitWidgets: yes']),
(None, ['sip: yes', 'colorama: yes', 'pypeg2: yes', 'jinja2: yes', (None, ['sip: yes', 'colorama: yes', 'pypeg2: yes', 'jinja2: yes',
'pygments: yes', 'yaml: yes', 'cssutils: yes', 'typing: yes', 'pygments: yes', 'yaml: yes', 'cssutils: yes', 'typing: yes',
'PyQt5.QtWebEngineWidgets: yes', 'OpenGL: yes', 'PyQt5.QtWebEngineWidgets: yes',
'PyQt5.QtWebKitWidgets: yes']), 'PyQt5.QtWebKitWidgets: yes']),
]) ])
def test_version_attribute(self, value, expected, import_fake): def test_version_attribute(self, value, expected, import_fake):