From 750ef834dc6c13842802b50985438c6394f0b6f5 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 20 Jun 2017 13:05:53 +0200 Subject: [PATCH] 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. --- CHANGELOG.asciidoc | 3 +-- README.asciidoc | 1 + qutebrowser/browser/webengine/webenginesettings.py | 7 +------ qutebrowser/misc/earlyinit.py | 1 + qutebrowser/utils/version.py | 1 + requirements.txt | 1 + tests/unit/utils/test_version.py | 9 +++++---- 7 files changed, 11 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 3fff2118c..353bd3d00 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -23,8 +23,7 @@ New dependencies - New dependency on `PyQt5.QtOpenGL` if QtWebEngine is used. QtWebEngine depends on QtOpenGL already, but on distributions packaging split PyQt5 wrappers, the wrappers for QtOpenGL are now required. -- New optional (but recommended) `PyOpenGL` dependency with QtWebEngine to work - around a bug where a black screen is shown with some setups. +- New dependency on `PyOpenGL` if QtWebEngine is used. Added ~~~~~ diff --git a/README.asciidoc b/README.asciidoc index b11ef1e8c..daa008a83 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -108,6 +108,7 @@ 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 and provide a better user experience: diff --git a/qutebrowser/browser/webengine/webenginesettings.py b/qutebrowser/browser/webengine/webenginesettings.py index 76c2aa4ec..f4c589150 100644 --- a/qutebrowser/browser/webengine/webenginesettings.py +++ b/qutebrowser/browser/webengine/webenginesettings.py @@ -209,12 +209,7 @@ def init(args): if not os.environ.get('QUTE_NO_OPENGL_WORKAROUND'): # Hide "No OpenGL_accelerate module loaded: ..." message logging.getLogger('OpenGL.acceleratesupport').propagate = False - try: - from OpenGL import GL # pylint: disable=unused-variable - except ImportError: - pass - else: - log.misc.debug("Imported PyOpenGL as workaround") + from OpenGL import GL # pylint: disable=unused-variable _init_profiles() diff --git a/qutebrowser/misc/earlyinit.py b/qutebrowser/misc/earlyinit.py index 9391288de..e0cbfbbc9 100644 --- a/qutebrowser/misc/earlyinit.py +++ b/qutebrowser/misc/earlyinit.py @@ -341,6 +341,7 @@ def check_libraries(backend): modules['PyQt5.QtWebEngineWidgets'] = _missing_str("QtWebEngine", webengine=True) modules['PyQt5.QtOpenGL'] = _missing_str("PyQt5.QtOpenGL") + modules['OpenGL'] = _missing_str("PyOpenGL") else: assert backend == 'webkit' modules['PyQt5.QtWebKit'] = _missing_str("PyQt5.QtWebKit") diff --git a/qutebrowser/utils/version.py b/qutebrowser/utils/version.py index 08779e097..e1cc26e64 100644 --- a/qutebrowser/utils/version.py +++ b/qutebrowser/utils/version.py @@ -186,6 +186,7 @@ def _module_versions(): ('yaml', ['__version__']), ('cssutils', ['__version__']), ('typing', []), + ('OpenGL', ['__version__']), ('PyQt5.QtWebEngineWidgets', []), ('PyQt5.QtWebKitWidgets', []), ]) diff --git a/requirements.txt b/requirements.txt index b2cc93c1f..cbf9ba407 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,3 +7,4 @@ MarkupSafe==1.0 Pygments==2.2.0 pyPEG2==2.15.2 PyYAML==3.12 +PyOpenGL==3.1.0 diff --git a/tests/unit/utils/test_version.py b/tests/unit/utils/test_version.py index 25c4f851f..32c3fcf5c 100644 --- a/tests/unit/utils/test_version.py +++ b/tests/unit/utils/test_version.py @@ -496,6 +496,7 @@ class ImportFake: 'typing': True, 'PyQt5.QtWebEngineWidgets': True, 'PyQt5.QtWebKitWidgets': True, + 'OpenGL': True, } self.version_attribute = '__version__' self.version = '1.2.3' @@ -555,7 +556,7 @@ class TestModuleVersions: """Test with all modules present in version 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', - 'cssutils: 1.2.3', 'typing: yes', + 'cssutils: 1.2.3', 'typing: yes', 'OpenGL: 1.2.3', 'PyQt5.QtWebEngineWidgets: yes', 'PyQt5.QtWebKitWidgets: yes'] assert version._module_versions() == expected @@ -579,17 +580,17 @@ class TestModuleVersions: @pytest.mark.parametrize('value, expected', [ ('VERSION', ['sip: yes', 'colorama: 1.2.3', 'pypeg2: yes', 'jinja2: yes', 'pygments: yes', 'yaml: yes', - 'cssutils: yes', 'typing: yes', + 'cssutils: yes', 'typing: yes', 'OpenGL: yes', 'PyQt5.QtWebEngineWidgets: yes', 'PyQt5.QtWebKitWidgets: yes']), ('SIP_VERSION_STR', ['sip: 1.2.3', 'colorama: yes', 'pypeg2: yes', 'jinja2: yes', 'pygments: yes', 'yaml: yes', - 'cssutils: yes', 'typing: yes', + 'cssutils: yes', 'typing: yes', 'OpenGL: yes', 'PyQt5.QtWebEngineWidgets: yes', 'PyQt5.QtWebKitWidgets: yes']), (None, ['sip: yes', 'colorama: yes', 'pypeg2: yes', 'jinja2: yes', 'pygments: yes', 'yaml: yes', 'cssutils: yes', 'typing: yes', - 'PyQt5.QtWebEngineWidgets: yes', + 'OpenGL: yes', 'PyQt5.QtWebEngineWidgets: yes', 'PyQt5.QtWebKitWidgets: yes']), ]) def test_version_attribute(self, value, expected, import_fake):