diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-07-10 11:59:02 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-07-10 12:13:01 +0200 |
commit | cfc8aefc46266217c4c94b0e128aed1bb671c84f (patch) | |
tree | a24ea96457cc522d84cf678c9382eb2627172b69 | |
parent | 1a9e74bfaf9a9db2a510dc14572d33ded6040a57 (diff) | |
download | qutebrowser-cfc8aefc46266217c4c94b0e128aed1bb671c84f.tar.gz qutebrowser-cfc8aefc46266217c4c94b0e128aed1bb671c84f.zip |
qtargs: Enable WebRTC pipewire capturer by default
See #5421
-rw-r--r-- | qutebrowser/config/qtargs.py | 22 | ||||
-rw-r--r-- | tests/unit/config/test_qtargs.py | 8 |
2 files changed, 29 insertions, 1 deletions
diff --git a/qutebrowser/config/qtargs.py b/qutebrowser/config/qtargs.py index 6e70ab70a..418ae7140 100644 --- a/qutebrowser/config/qtargs.py +++ b/qutebrowser/config/qtargs.py @@ -158,7 +158,29 @@ def _qtwebengine_enabled_features( flag = flag[len(prefix):] yield from iter(flag.split(',')) + if qtutils.version_check('5.15', compiled=False) and utils.is_linux: + # Enable WebRTC PipeWire for screen capturing on Wayland. + # + # This is disabled in Chromium by default because of the "dialog hell": + # https://bugs.chromium.org/p/chromium/issues/detail?id=682122#c50 + # https://github.com/flatpak/xdg-desktop-portal-gtk/issues/204 + # + # However, we don't have Chromium's confirmation dialog in qutebrowser, + # so we should only get qutebrowser's permission dialog. + # + # In theory this would be supported with Qt 5.13 already, but + # QtWebEngine only started picking up PipeWire correctly with Qt + # 5.15.1. Checking for 5.15 here to pick up Archlinux' patched package + # as well. + # + # This only should be enabled on Wayland, but it's too early to check + # that, as we don't have a QApplication available at this point. Thus, + # just turn it on unconditionally on Linux, which shouldn't hurt. + yield 'WebRTCPipeWireCapturer' + if qtutils.version_check('5.11', compiled=False) and not utils.is_mac: + # Enable overlay scrollbars. + # # There are two additional flags in Chromium: # # - OverlayScrollbarFlashAfterAnyScrollUpdate diff --git a/tests/unit/config/test_qtargs.py b/tests/unit/config/test_qtargs.py index 0a42dbf4f..0b3cc7c2b 100644 --- a/tests/unit/config/test_qtargs.py +++ b/tests/unit/config/test_qtargs.py @@ -61,10 +61,12 @@ class TestQtArgs: (['--qt-flag', 'foo', '--qt-flag', 'bar'], [sys.argv[0], '--foo', '--bar']), ]) - def test_qt_args(self, config_stub, args, expected, parser): + def test_qt_args(self, monkeypatch, config_stub, args, expected, parser): """Test commandline with no Qt arguments given.""" # Avoid scrollbar overlay argument config_stub.val.scrolling.bar = 'never' + # Avoid WebRTC pipewire feature + monkeypatch.setattr(qtargs.utils, 'is_linux', False) parsed = parser.parse_args(args) assert qtargs.qt_args(parsed) == expected @@ -327,6 +329,8 @@ class TestQtArgs: lambda version, exact=False, compiled=True: new_qt) monkeypatch.setattr(qtargs.utils, 'is_mac', is_mac) + # Avoid WebRTC pipewire feature + monkeypatch.setattr(qtargs.utils, 'is_linux', False) config_stub.val.scrolling.bar = bar @@ -357,6 +361,8 @@ class TestQtArgs: lambda version, exact=False, compiled=True: True) monkeypatch.setattr(qtargs.utils, 'is_mac', False) + # Avoid WebRTC pipewire feature + monkeypatch.setattr(qtargs.utils, 'is_linux', False) stripped_prefix = 'enable-features=' config_flag = stripped_prefix + passed_features |