diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-03-17 21:01:20 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-03-17 21:02:40 +0100 |
commit | 3309ee65ede64286eb231c9203696b736ff7bcf3 (patch) | |
tree | 27e12fac68f23001c2bca6484c719ed46706a823 | |
parent | ec919b0f790e2290fb13459ed9043fcb5708143e (diff) | |
download | qutebrowser-3309ee65ede64286eb231c9203696b736ff7bcf3.tar.gz qutebrowser-3309ee65ede64286eb231c9203696b736ff7bcf3.zip |
Drop libgl workaround entirely
-rw-r--r-- | doc/changelog.asciidoc | 7 | ||||
-rw-r--r-- | qutebrowser/misc/backendproblem.py | 13 | ||||
-rw-r--r-- | qutebrowser/misc/earlyinit.py | 5 | ||||
-rw-r--r-- | qutebrowser/utils/utils.py | 15 | ||||
-rw-r--r-- | qutebrowser/utils/version.py | 3 | ||||
-rw-r--r-- | tests/conftest.py | 6 | ||||
-rw-r--r-- | tests/unit/utils/test_utils.py | 7 |
7 files changed, 12 insertions, 44 deletions
diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index fa6186132..9c7a69d3c 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -19,6 +19,13 @@ breaking changes (such as renamed commands) can happen in minor releases. v2.2.0 (unreleased) ------------------- +Deprecated +~~~~~~~~~~ + +- Running qutebrowser with Qt 5.12.0 is now unsupported and logs a warning. It + should still work, however, a workaround for issues with the Nvidia graphic + driver was dropped. Newer Qt 5.12.x versions are still fully supported. + Added ~~~~~ diff --git a/qutebrowser/misc/backendproblem.py b/qutebrowser/misc/backendproblem.py index 27b98777a..001aa3047 100644 --- a/qutebrowser/misc/backendproblem.py +++ b/qutebrowser/misc/backendproblem.py @@ -194,18 +194,6 @@ class _BackendProblemChecker: sys.exit(usertypes.Exit.err_init) - def _nvidia_shader_workaround(self) -> None: - """Work around QOpenGLShaderProgram issues. - - See https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/941826 - and https://bugreports.qt.io/browse/QTBUG-71488 - """ - # https://codereview.qt-project.org/c/qt/qtbase/+/245294 - if qtutils.version_check('5.12.1', compiled=False): - return - self._assert_backend(usertypes.Backend.QtWebEngine) - utils.libgl_workaround() - def _xwayland_options(self) -> Tuple[str, List[_Button]]: """Get buttons/text for a possible XWayland solution.""" buttons = [] @@ -439,7 +427,6 @@ class _BackendProblemChecker: self._check_backend_modules() if objects.backend == usertypes.Backend.QtWebEngine: self._handle_ssl_support() - self._nvidia_shader_workaround() self._handle_wayland_webgl() self._handle_cache_nuking() self._handle_serviceworker_nuking() diff --git a/qutebrowser/misc/earlyinit.py b/qutebrowser/misc/earlyinit.py index 420f90f9a..b154eaca8 100644 --- a/qutebrowser/misc/earlyinit.py +++ b/qutebrowser/misc/earlyinit.py @@ -185,6 +185,11 @@ def check_qt_version(): PYQT_VERSION_STR)) _die(text) + if qt_ver == QVersionNumber(5, 12, 0): + from qutebrowser.utils import log + log.init.warning("Running on Qt 5.12.0. Doing so is unsupported " + "(newer 5.12.x versions are fine).") + def check_ssl_support(): """Check if SSL support is available.""" diff --git a/qutebrowser/utils/utils.py b/qutebrowser/utils/utils.py index 03a3c7842..afc4c4f8d 100644 --- a/qutebrowser/utils/utils.py +++ b/qutebrowser/utils/utils.py @@ -32,8 +32,6 @@ import functools import contextlib import shlex import mimetypes -import ctypes -import ctypes.util from typing import (Any, Callable, IO, Iterator, Optional, Sequence, Tuple, Type, Union, TypeVar, TYPE_CHECKING) @@ -753,19 +751,6 @@ def ceil_log(number: int, base: int) -> int: return result -def libgl_workaround() -> None: - """Work around QOpenGLShaderProgram issues, especially for Nvidia. - - See https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/941826 - """ - if os.environ.get('QUTE_SKIP_LIBGL_WORKAROUND'): - return - - libgl = ctypes.util.find_library("GL") - if libgl is not None: # pragma: no branch - ctypes.CDLL(libgl, mode=ctypes.RTLD_GLOBAL) - - def parse_duration(duration: str) -> int: """Parse duration in format XhYmZs into milliseconds duration.""" if duration.isdigit(): diff --git a/qutebrowser/utils/version.py b/qutebrowser/utils/version.py index a1b8e6c72..97b286fba 100644 --- a/qutebrowser/utils/version.py +++ b/qutebrowser/utils/version.py @@ -882,9 +882,6 @@ def opengl_info() -> Optional[OpenGLInfo]: # pragma: no cover """ assert QApplication.instance() - # Some setups can segfault in here if we don't do this. - utils.libgl_workaround() - override = os.environ.get('QUTE_FAKE_OPENGL') if override is not None: log.init.debug("Using override {}".format(override)) diff --git a/tests/conftest.py b/tests/conftest.py index ee945ac4c..7b8cf2753 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -239,12 +239,6 @@ def set_backend(monkeypatch, request): monkeypatch.setattr(objects, 'backend', backend) -@pytest.fixture(autouse=True, scope='session') -def apply_libgl_workaround(): - """Make sure we load libGL early so QtWebEngine tests run properly.""" - utils.libgl_workaround() - - @pytest.fixture(autouse=True) def apply_fake_os(monkeypatch, request): fake_os = request.node.get_closest_marker('fake_os') diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py index b43638cb3..2c726ddb6 100644 --- a/tests/unit/utils/test_utils.py +++ b/tests/unit/utils/test_utils.py @@ -892,13 +892,6 @@ def test_ceil_log_invalid(number, base): utils.ceil_log(number, base) -@pytest.mark.parametrize('skip', [True, False]) -def test_libgl_workaround(monkeypatch, skip): - if skip: - monkeypatch.setenv('QUTE_SKIP_LIBGL_WORKAROUND', '1') - utils.libgl_workaround() # Just make sure it doesn't crash. - - @pytest.mark.parametrize('duration, out', [ ("0", 0), ("0s", 0), |