diff options
author | toofar <toofar@spalge.com> | 2023-12-02 12:53:44 +1300 |
---|---|---|
committer | toofar <toofar@spalge.com> | 2023-12-02 12:53:44 +1300 |
commit | 75c78cadc4c7391df4654798b4b6de0c96007597 (patch) | |
tree | 46013d8db364d372da7508c6db58020475caf858 | |
parent | 1aa3c952aba8054f01504760c971d80de42db8af (diff) | |
download | qutebrowser-75c78cadc4c7391df4654798b4b6de0c96007597.tar.gz qutebrowser-75c78cadc4c7391df4654798b4b6de0c96007597.zip |
Always disable accelerated canvas if set to auto on Qt6
We thought #7489 would be fixed on chrome 112 but it appears to still be
an issue. As discussed on the issue, it's not clear how many workflows
would be affected by accelerated 2d canvas and we don't have enough data
to detect the affected graphics configurations. So lets just disable
accelerated 2d canvas by default and users who want it turned on can do
so via the setting.
If some major use case pops up to enable this by default where possible
we can revisit and think of more nuanced feature detection.
I've kept the handling of callable values of `_WEBENGINE_SETTINGS`
because I don't like have to have something like
`--disable-accelerated-2d-canvas` written in code twice. The setting
above this one could probably be changed to use it too.
-rw-r--r-- | qutebrowser/config/qtargs.py | 4 | ||||
-rw-r--r-- | tests/unit/config/test_qtargs.py | 14 |
2 files changed, 6 insertions, 12 deletions
diff --git a/qutebrowser/config/qtargs.py b/qutebrowser/config/qtargs.py index 934953d0a..4fa6aa43f 100644 --- a/qutebrowser/config/qtargs.py +++ b/qutebrowser/config/qtargs.py @@ -336,10 +336,8 @@ _WEBENGINE_SETTINGS: Dict[str, Dict[Any, Optional[_SettingValueType]]] = { 'qt.workarounds.disable_accelerated_2d_canvas': { 'always': '--disable-accelerated-2d-canvas', 'never': None, - 'auto': lambda versions: 'always' + 'auto': lambda _versions: 'always' if machinery.IS_QT6 - and versions.chromium_major - and versions.chromium_major < 111 else 'never', }, } diff --git a/tests/unit/config/test_qtargs.py b/tests/unit/config/test_qtargs.py index 419faad12..2414d4ba9 100644 --- a/tests/unit/config/test_qtargs.py +++ b/tests/unit/config/test_qtargs.py @@ -156,14 +156,12 @@ class TestWebEngineArgs: assert '--enable-in-process-stack-traces' not in args @pytest.mark.parametrize( - 'qt_version, qt6, value, has_arg', + 'qt6, value, has_arg', [ - ('5.15.2', False, 'auto', False), - ('6.5.3', True, 'auto', True), - ('6.6.0', True, 'auto', False), - ('6.5.3', True, 'always', True), - ('6.5.3', True, 'never', False), - ('6.6.0', True, 'always', True), + (False, 'auto', False), + (True, 'auto', True), + (True, 'always', True), + (True, 'never', False), ], ) def test_accelerated_2d_canvas( @@ -172,12 +170,10 @@ class TestWebEngineArgs: version_patcher, config_stub, monkeypatch, - qt_version, qt6, value, has_arg, ): - version_patcher(qt_version) config_stub.val.qt.workarounds.disable_accelerated_2d_canvas = value monkeypatch.setattr(machinery, 'IS_QT6', qt6) |