From 0c674c71100e77a1596e6767749b7dbd9809233c Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 14 May 2018 18:48:14 +0200 Subject: [PATCH 01/28] Update flake8-builtins from 1.3.1 to 1.4.1 --- misc/requirements/requirements-flake8.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-flake8.txt b/misc/requirements/requirements-flake8.txt index a29b2293c..cbe996ce4 100644 --- a/misc/requirements/requirements-flake8.txt +++ b/misc/requirements/requirements-flake8.txt @@ -3,7 +3,7 @@ attrs==18.1.0 flake8==3.5.0 flake8-bugbear==18.2.0 -flake8-builtins==1.3.1 # rq.filter: != 1.4.0 +flake8-builtins==1.4.1 # rq.filter: != 1.4.0 flake8-comprehensions==1.4.1 flake8-copyright==0.2.0 flake8-debugger==3.1.0 From b0f83615b69875b81d0ea5c0f1d1ebfed0d9c204 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 14 May 2018 18:48:15 +0200 Subject: [PATCH 02/28] Update wheel from 0.31.0 to 0.31.1 --- misc/requirements/requirements-pip.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pip.txt b/misc/requirements/requirements-pip.txt index 60f24f057..34dc41d4d 100644 --- a/misc/requirements/requirements-pip.txt +++ b/misc/requirements/requirements-pip.txt @@ -5,4 +5,4 @@ packaging==17.1 pyparsing==2.2.0 setuptools==39.1.0 six==1.11.0 -wheel==0.31.0 +wheel==0.31.1 From 553a91c012fbdefc9beb00514ce6563eb379f4c5 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 14 May 2018 18:48:17 +0200 Subject: [PATCH 03/28] Update python-dateutil from 2.7.2 to 2.7.3 --- misc/requirements/requirements-pylint-master.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint-master.txt b/misc/requirements/requirements-pylint-master.txt index 391526ad0..878f1390f 100644 --- a/misc/requirements/requirements-pylint-master.txt +++ b/misc/requirements/requirements-pylint-master.txt @@ -9,7 +9,7 @@ isort==4.3.4 lazy-object-proxy==1.3.1 mccabe==0.6.1 -e git+https://github.com/PyCQA/pylint.git#egg=pylint -python-dateutil==2.7.2 +python-dateutil==2.7.3 ./scripts/dev/pylint_checkers requests==2.18.4 six==1.11.0 From b0105b01578366d671ef70b032b69de4d9deae86 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 14 May 2018 18:48:18 +0200 Subject: [PATCH 04/28] Update python-dateutil from 2.7.2 to 2.7.3 --- misc/requirements/requirements-pylint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index 997a6edb6..28add7741 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -9,7 +9,7 @@ isort==4.3.4 lazy-object-proxy==1.3.1 mccabe==0.6.1 pylint==1.8.4 -python-dateutil==2.7.2 +python-dateutil==2.7.3 ./scripts/dev/pylint_checkers requests==2.18.4 six==1.11.0 From 6784356d9de61a609f2eb8336ae84f13438a0a8b Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 14 May 2018 18:48:20 +0200 Subject: [PATCH 05/28] Update hypothesis from 3.56.5 to 3.56.9 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 2d3fb1020..cddf48309 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -11,7 +11,7 @@ fields==5.0.0 Flask==1.0.2 glob2==0.6 hunter==2.0.2 -hypothesis==3.56.5 +hypothesis==3.56.9 itsdangerous==0.24 # Jinja2==2.10 Mako==1.0.7 From 6eadff4a1047e72765e2082cc460442ffd81adee Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 14 May 2018 22:13:15 +0200 Subject: [PATCH 06/28] Add Python executable to :version --- qutebrowser/utils/version.py | 1 + tests/unit/utils/test_version.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/qutebrowser/utils/version.py b/qutebrowser/utils/version.py index 86973a3de..47e054bec 100644 --- a/qutebrowser/utils/version.py +++ b/qutebrowser/utils/version.py @@ -399,6 +399,7 @@ def version(): lines += [ 'Frozen: {}'.format(hasattr(sys, 'frozen')), "Imported from {}".format(importpath), + "Using Python from {}".format(sys.executable), "Qt library executable path: {}, data path: {}".format( QLibraryInfo.location(QLibraryInfo.LibraryExecutablesPath), QLibraryInfo.location(QLibraryInfo.DataPath) diff --git a/tests/unit/utils/test_version.py b/tests/unit/utils/test_version.py index fe45fec97..683fba02e 100644 --- a/tests/unit/utils/test_version.py +++ b/tests/unit/utils/test_version.py @@ -874,6 +874,7 @@ def test_version_output(params, stubs, monkeypatch): '_git_str': lambda: ('GIT COMMIT' if params.git_commit else None), 'platform.python_implementation': lambda: 'PYTHON IMPLEMENTATION', 'platform.python_version': lambda: 'PYTHON VERSION', + 'sys.executable': 'EXECUTABLE PATH', 'PYQT_VERSION_STR': 'PYQT VERSION', 'earlyinit.qt_version': lambda: 'QT VERSION', '_module_versions': lambda: ['MODULE VERSION 1', 'MODULE VERSION 2'], @@ -897,6 +898,7 @@ def test_version_output(params, stubs, monkeypatch): 'qt': 'QT VERSION', 'frozen': str(params.frozen), 'import_path': import_path, + 'python_path': 'EXECUTABLE PATH', } if params.with_webkit: @@ -951,6 +953,7 @@ def test_version_output(params, stubs, monkeypatch): Platform: PLATFORM, ARCHITECTURE{linuxdist} Frozen: {frozen} Imported from {import_path} + Using Python from {python_path} Qt library executable path: QT PATH, data path: QT PATH {osinfo} Paths: From 44d26f77a5007177a4a7df4c811b0b2cf084dbc6 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 17 May 2018 14:21:14 +0200 Subject: [PATCH 07/28] Add workaround for the "split page" Qt bug (QTBUG-68224) Fixes #3920 --- qutebrowser/browser/webengine/webenginetab.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index fb04dc120..672675b9e 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -1057,6 +1057,22 @@ class WebEngineTab(browsertab.AbstractTab): @pyqtSlot(usertypes.NavigationRequest) def _on_navigation_request(self, navigation): super()._on_navigation_request(navigation) + + if qtutils.version_check('5.11.0', exact=True, compiled=False): + # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-68224 + layout = self._widget.layout() + count = layout.count() + if count > 1: + for i in range(count): + item = layout.itemAt(i) + if item is None: + continue + widget = item.widget() + if widget is not self._widget.focusProxy(): + log.webview.debug("Removing widget {} (QTBUG-68224)" + .format(widget)) + layout.removeWidget(widget) + if not navigation.accepted or not navigation.is_main_frame: return From d8569a36f92b950a8dbeae18e483c2b61fa5e764 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 17 May 2018 14:24:29 +0200 Subject: [PATCH 08/28] Update changelog --- doc/changelog.asciidoc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 3c6c796c7..3f7a3abc7 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -36,6 +36,15 @@ Changed - There's now completion for commands taking a variable count of arguments (like `:config-cycle`). + +v1.3.1 (unreleased) +------------------- + +Added +~~~~~ + +- Work around a bug in Qt 5.11 where only the top/bottom half of the window is used. + v1.3.0 ------ From 6ccd69dad200682f7f4ace9d093a444c14825499 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 17 May 2018 15:51:14 +0200 Subject: [PATCH 09/28] Fix reload for JavaScript support on Qt 5.11 --- qutebrowser/browser/webengine/webenginetab.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 672675b9e..c451305f0 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -1076,7 +1076,7 @@ class WebEngineTab(browsertab.AbstractTab): if not navigation.accepted or not navigation.is_main_frame: return - needs_reload = { + settings_needing_reload = { 'content.plugins', 'content.javascript.enabled', 'content.javascript.can_access_clipboard', @@ -1085,11 +1085,20 @@ class WebEngineTab(browsertab.AbstractTab): 'input.spatial_navigation', 'input.spatial_navigation', } - assert needs_reload.issubset(configdata.DATA) + assert settings_needing_reload.issubset(configdata.DATA) changed = self.settings.update_for_url(navigation.url) - if (changed & needs_reload and navigation.navigation_type != - navigation.Type.link_clicked): + reload_needed = changed & settings_needing_reload + + # On Qt < 5.11, we don't don't need a reload when type == link_clicked. + # On Qt 5.11.0, we always need a reload. + # TODO on Qt > 5.11.0, we hopefully never need a reload: + # https://codereview.qt-project.org/#/c/229525/1 + if not qtutils.version_check('5.11.0', exact=True, compiled=False): + if navigation.navigation_type != navigation.Type.link_clicked: + reload_needed = False + + if reload_needed: # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-66656 self._reload_url = navigation.url From dacca0d2ed8f05c5bf632aa022536f29ad177deb Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 17 May 2018 15:52:22 +0200 Subject: [PATCH 10/28] Remove double settings --- qutebrowser/browser/webengine/webenginetab.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index c451305f0..1eba686c9 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -1080,10 +1080,8 @@ class WebEngineTab(browsertab.AbstractTab): 'content.plugins', 'content.javascript.enabled', 'content.javascript.can_access_clipboard', - 'content.javascript.can_access_clipboard', 'content.print_element_backgrounds', 'input.spatial_navigation', - 'input.spatial_navigation', } assert settings_needing_reload.issubset(configdata.DATA) From d208c48532bba60c5bc3dd1dc4056adf7c100582 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 17 May 2018 17:40:09 +0200 Subject: [PATCH 11/28] Update changelog --- doc/changelog.asciidoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 3f7a3abc7..417e3e450 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -45,6 +45,12 @@ Added - Work around a bug in Qt 5.11 where only the top/bottom half of the window is used. +Fixed +~~~~~ + +- Work around an issue in Qt 5.11 where e.g. activating JavaScript per-domain + needed a manual relaod in some cases. + v1.3.0 ------ From a31542269acb6a786785752a286612e7a18fb77e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 20 May 2018 16:12:33 +0200 Subject: [PATCH 12/28] Remove old files from MANIFEST.in --- MANIFEST.in | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 242fea292..ff96264aa 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,5 @@ recursive-include qutebrowser *.py recursive-include qutebrowser/img *.svg *.png -recursive-include qutebrowser/test *.py recursive-include qutebrowser/javascript *.js graft qutebrowser/html graft qutebrowser/3rdparty @@ -27,20 +26,18 @@ prune scripts/dev prune scripts/testbrowser/cpp prune .github exclude scripts/asciidoc2html.py -exclude doc/notes recursive-exclude doc *.asciidoc include doc/qutebrowser.1.asciidoc include doc/changelog.asciidoc prune tests prune qutebrowser/3rdparty exclude pytest.ini -exclude qutebrowser.rcc exclude qutebrowser/javascript/.eslintrc.yaml exclude qutebrowser/javascript/.eslintignore exclude doc/help exclude .* -exclude misc/appveyor_install.py exclude misc/qutebrowser.spec exclude misc/qutebrowser.nsi +exclude misc/qutebrowser.rcc global-exclude __pycache__ *.pyc *.pyo From 5df4128e8d554225fae72d81148321f0609f158b Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 21 May 2018 18:53:13 +0200 Subject: [PATCH 13/28] Update pep8-naming from 0.6.1 to 0.7.0 --- misc/requirements/requirements-flake8.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-flake8.txt b/misc/requirements/requirements-flake8.txt index cbe996ce4..0c33cb700 100644 --- a/misc/requirements/requirements-flake8.txt +++ b/misc/requirements/requirements-flake8.txt @@ -18,7 +18,7 @@ flake8-tidy-imports==1.1.0 flake8-tuple==0.2.13 mccabe==0.6.1 pathmatch==0.2.1 -pep8-naming==0.6.1 +pep8-naming==0.7.0 pycodestyle==2.3.1 # rq.filter: < 2.4.0 pydocstyle==2.1.1 pyflakes==1.6.0 From 5ec3f1949a48eb172ce0a376bdf017b621412adc Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 21 May 2018 18:53:14 +0200 Subject: [PATCH 14/28] Update pyflakes from 1.6.0 to 2.0.0 --- misc/requirements/requirements-flake8.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-flake8.txt b/misc/requirements/requirements-flake8.txt index 0c33cb700..879f24cd0 100644 --- a/misc/requirements/requirements-flake8.txt +++ b/misc/requirements/requirements-flake8.txt @@ -21,7 +21,7 @@ pathmatch==0.2.1 pep8-naming==0.7.0 pycodestyle==2.3.1 # rq.filter: < 2.4.0 pydocstyle==2.1.1 -pyflakes==1.6.0 +pyflakes==2.0.0 six==1.11.0 snowballstemmer==1.2.1 typing==3.6.4 From e7a779ef90c90194cf725037d3a44c7af72e5d57 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 21 May 2018 18:53:16 +0200 Subject: [PATCH 15/28] Update setuptools from 39.1.0 to 39.2.0 --- misc/requirements/requirements-pip.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pip.txt b/misc/requirements/requirements-pip.txt index 34dc41d4d..64b096747 100644 --- a/misc/requirements/requirements-pip.txt +++ b/misc/requirements/requirements-pip.txt @@ -3,6 +3,6 @@ appdirs==1.4.3 packaging==17.1 pyparsing==2.2.0 -setuptools==39.1.0 +setuptools==39.2.0 six==1.11.0 wheel==0.31.1 From 9dc9ec34355a0df6a084a5e3747ac119006435bb Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 21 May 2018 18:53:17 +0200 Subject: [PATCH 16/28] Update astroid from 1.6.3 to 1.6.4 --- misc/requirements/requirements-pylint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index 28add7741..cb2b70c8f 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -1,6 +1,6 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -astroid==1.6.3 +astroid==1.6.4 certifi==2018.4.16 chardet==3.0.4 github3.py==1.1.0 From f60c42b7fb46822d575740472f7b0b33c06fb217 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 21 May 2018 18:53:19 +0200 Subject: [PATCH 17/28] Update pylint from 1.8.4 to 1.9.1 --- misc/requirements/requirements-pylint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index cb2b70c8f..55036ec8d 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -8,7 +8,7 @@ idna==2.6 isort==4.3.4 lazy-object-proxy==1.3.1 mccabe==0.6.1 -pylint==1.8.4 +pylint==1.9.1 python-dateutil==2.7.3 ./scripts/dev/pylint_checkers requests==2.18.4 From 725a133b9a17dbb9c946d1c0a4366a832e1bcedf Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 21 May 2018 18:53:20 +0200 Subject: [PATCH 18/28] Update cheroot from 6.2.4 to 6.3.1 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index cddf48309..e41caa1c8 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -2,7 +2,7 @@ attrs==18.1.0 beautifulsoup4==4.6.0 -cheroot==6.2.4 +cheroot==6.3.1 click==6.7 # colorama==0.3.9 coverage==4.5.1 From 616371a3c1ec768a225a4fe6a91cc6ad10e310ec Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 21 May 2018 18:53:22 +0200 Subject: [PATCH 19/28] Update hypothesis from 3.56.9 to 3.57.0 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index e41caa1c8..5c8257cb1 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -11,7 +11,7 @@ fields==5.0.0 Flask==1.0.2 glob2==0.6 hunter==2.0.2 -hypothesis==3.56.9 +hypothesis==3.57.0 itsdangerous==0.24 # Jinja2==2.10 Mako==1.0.7 From 7596dbdd437f21f7c1fc4cda58efb25d000cdd12 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 21 May 2018 18:53:23 +0200 Subject: [PATCH 20/28] Update pytest-instafail from 0.3.0 to 0.4.0 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 5c8257cb1..5191cece0 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -27,7 +27,7 @@ pytest-bdd==2.21.0 pytest-benchmark==3.1.1 pytest-cov==2.5.1 pytest-faulthandler==1.5.0 -pytest-instafail==0.3.0 +pytest-instafail==0.4.0 pytest-mock==1.10.0 pytest-qt==2.3.1 pytest-repeat==0.4.1 From c551e29f4c299e6dd55f2dfba09f82df9e8710ed Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 21 May 2018 18:53:25 +0200 Subject: [PATCH 21/28] Update pytest-qt from 2.3.1 to 2.3.2 --- misc/requirements/requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 5191cece0..a2d4df525 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -29,7 +29,7 @@ pytest-cov==2.5.1 pytest-faulthandler==1.5.0 pytest-instafail==0.4.0 pytest-mock==1.10.0 -pytest-qt==2.3.1 +pytest-qt==2.3.2 pytest-repeat==0.4.1 pytest-rerunfailures==4.0 pytest-travis-fold==1.3.0 From 228c86c79901e6fccba1761a279d6bf0bb1c857e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 21 May 2018 18:53:26 +0200 Subject: [PATCH 22/28] Update virtualenv from 15.2.0 to 16.0.0 --- misc/requirements/requirements-tox.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements-tox.txt b/misc/requirements/requirements-tox.txt index f5344f57e..e8b3de2b1 100644 --- a/misc/requirements/requirements-tox.txt +++ b/misc/requirements/requirements-tox.txt @@ -4,4 +4,4 @@ pluggy==0.6.0 py==1.5.3 six==1.11.0 tox==3.0.0 -virtualenv==15.2.0 +virtualenv==16.0.0 From 89f019b7105c7bb3ef7179942ebb1382f06c3fbd Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 21 May 2018 20:03:18 +0200 Subject: [PATCH 23/28] Remove unneeded "except ... as e:" assignments --- qutebrowser/browser/commands.py | 2 +- qutebrowser/browser/qutescheme.py | 2 +- qutebrowser/config/configdata.py | 2 +- qutebrowser/config/configfiles.py | 2 +- qutebrowser/config/configtypes.py | 2 +- qutebrowser/misc/crashdialog.py | 2 +- qutebrowser/misc/ipc.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 60844029f..1674a7eb0 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1674,7 +1674,7 @@ class CommandDispatcher: """ try: elem.set_value(text) - except webelem.OrphanedError as e: + except webelem.OrphanedError: message.error('Edited element vanished') ed.backup() except webelem.Error as e: diff --git a/qutebrowser/browser/qutescheme.py b/qutebrowser/browser/qutescheme.py index 8866f1643..6fc2a8429 100644 --- a/qutebrowser/browser/qutescheme.py +++ b/qutebrowser/browser/qutescheme.py @@ -177,7 +177,7 @@ def data_for_url(url): except OSError as e: # FIXME:qtwebengine how to handle this? raise QuteSchemeOSError(e) - except QuteSchemeError as e: + except QuteSchemeError: raise assert mimetype is not None, url diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index c617fca14..e9b33b5b8 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -102,7 +102,7 @@ def _parse_yaml_type(name, node): try: typ = getattr(configtypes, type_name) - except AttributeError as e: + except AttributeError: raise AttributeError("Did not find type {} for {}".format( type_name, name)) diff --git a/qutebrowser/config/configfiles.py b/qutebrowser/config/configfiles.py index 986ca3f56..25c0c9971 100644 --- a/qutebrowser/config/configfiles.py +++ b/qutebrowser/config/configfiles.py @@ -573,7 +573,7 @@ def read_autoconfig(): """Read the autoconfig.yml file.""" try: config.instance.read_yaml() - except configexc.ConfigFileErrors as e: + except configexc.ConfigFileErrors: raise # caught in outer block except configexc.Error as e: desc = configexc.ConfigErrorDesc("Error", e) diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index ecf1efe86..619dfd71d 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -1409,7 +1409,7 @@ class SearchEngineUrl(BaseType): try: value.format("") - except (KeyError, IndexError) as e: + except (KeyError, IndexError): raise configexc.ValidationError( value, "may not contain {...} (use {{ and }} for literal {/})") except ValueError as e: diff --git a/qutebrowser/misc/crashdialog.py b/qutebrowser/misc/crashdialog.py index 4d395b8ec..85fdf33bf 100644 --- a/qutebrowser/misc/crashdialog.py +++ b/qutebrowser/misc/crashdialog.py @@ -293,7 +293,7 @@ class _CrashDialog(QDialog): self._paste_text = '\n\n'.join(lines) try: user = getpass.getuser() - except Exception as e: + except Exception: log.misc.exception("Error while getting user") user = 'unknown' try: diff --git a/qutebrowser/misc/ipc.py b/qutebrowser/misc/ipc.py index 8af5ba6bf..3c718de7b 100644 --- a/qutebrowser/misc/ipc.py +++ b/qutebrowser/misc/ipc.py @@ -498,7 +498,7 @@ def send_or_listen(args): server = IPCServer(socketname) server.listen() return server - except AddressInUseError as e: + except AddressInUseError: # This could be a race condition... log.init.debug("Got AddressInUseError, trying again.") time.sleep(0.5) From bc37af7c9593b99b42cbdecdd5a890c7edb76024 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 22 May 2018 07:41:43 +0200 Subject: [PATCH 24/28] Document QtWebEngine internals [ci skip] --- doc/contributing.asciidoc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/contributing.asciidoc b/doc/contributing.asciidoc index ad48c1324..a8f17651a 100644 --- a/doc/contributing.asciidoc +++ b/doc/contributing.asciidoc @@ -567,6 +567,20 @@ can be useful for debugging: - chrome://ppapiflashcrash/ - chrome://ppapiflashhang/ +QtWebEngine internals +~~~~~~~~~~~~~~~~~~~~~ + +This is mostly useful for qutebrowser maintainers to work around issues in Qt - if you don't understand it, don't worry, just ignore it. + +The hierarchy of widgets when QtWebEngine is involved looks like this: + +- qutebrowser has a `WebEngineTab` object, which is its abstraction over QtWebKit/QtWebEngine. +- The `WebEngineTab` has a `_widget` attribute, which is the https://doc.qt.io/qt-5/qwebengineview.html[QWebEngineView] +- That view has a https://doc.qt.io/qt-5/qwebenginepage.html[QWebEnginePage] for everything which doesn't require rendering. +- The view also has a layout with exactly one element (which also is its `focusProxy()`) +- That element is the http://code.qt.io/cgit/qt/qtwebengine.git/tree/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp[RenderWidgetHostViewQtDelegateWidget] (it inherits https://doc.qt.io/qt-5/qquickwidget.html[QQuickWidget]) - also often referred to as RWHV or RWHVQDW. It can be obtained via `sip.cast(tab._widget.focusProxy(), QQuickWidget)`. +- Calling `rootObject()` on that gives us the https://doc.qt.io/qt-5/qquickitem.html[QQuickItem] where Chromium renders into (?). With it, we can do things like `.setRotation(20)`. + Style conventions ----------------- From 71ad8bdb47a4cd6a8321eb189533741ef6f806a4 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 22 May 2018 09:36:14 +0200 Subject: [PATCH 25/28] Properly work around Qt 5.11 keyboard focus issues Please let this be the last attempt... :D Fixes #3939 Supersedes #3921 Reverts ae295a7f652ed851ac8b258aa10500d72e6a52b6 See #3661 This should not regress #3872. Might affect #3834 in some way. --- qutebrowser/browser/mouse.py | 7 ++++++- qutebrowser/browser/webengine/webenginetab.py | 2 -- qutebrowser/mainwindow/tabbedbrowser.py | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/qutebrowser/browser/mouse.py b/qutebrowser/browser/mouse.py index 16a7f227e..43d234322 100644 --- a/qutebrowser/browser/mouse.py +++ b/qutebrowser/browser/mouse.py @@ -22,7 +22,7 @@ from PyQt5.QtCore import QObject, QEvent, Qt, QTimer from qutebrowser.config import config -from qutebrowser.utils import message, log, usertypes +from qutebrowser.utils import message, log, usertypes, qtutils from qutebrowser.keyinput import modeman @@ -54,6 +54,11 @@ class ChildEventFilter(QObject): obj, child)) assert obj is self._widget child.installEventFilter(self._filter) + + if qtutils.version_check('5.11', compiled=False, exact=True): + # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-68076 + QTimer.singleShot(0, self._widget.setFocus) + return False diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 1eba686c9..3fcc58738 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -789,8 +789,6 @@ class WebEngineTab(browsertab.AbstractTab): url: The QUrl to open. predict: If set to False, predicted_navigation is not emitted. """ - # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-68076 - self._widget.setFocus() self._saved_zoom = self.zoom.factor() self._openurl_prepare(url, predict=predict) self._widget.load(url) diff --git a/qutebrowser/mainwindow/tabbedbrowser.py b/qutebrowser/mainwindow/tabbedbrowser.py index 2d674e280..a35e8d7ef 100644 --- a/qutebrowser/mainwindow/tabbedbrowser.py +++ b/qutebrowser/mainwindow/tabbedbrowser.py @@ -490,6 +490,7 @@ class TabbedBrowser(QWidget): else: self.widget.setCurrentWidget(tab) # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-68076 + # Still seems to be needed with Qt 5.11.1 tab.setFocus() tab.show() From db1287cb82c216d1858abbd32bd9bbca3f86a6fd Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 22 May 2018 09:40:54 +0200 Subject: [PATCH 26/28] Update changelog --- doc/changelog.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 417e3e450..a5dbbb140 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -44,6 +44,7 @@ Added ~~~~~ - Work around a bug in Qt 5.11 where only the top/bottom half of the window is used. +- Work around keyboard focus issues with Qt 5.11 Fixed ~~~~~ From 29ad252278a3dab5f7d11181f93f65ef7b728d80 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 22 May 2018 12:25:45 +0200 Subject: [PATCH 27/28] =?UTF-8?q?Handle=20=C2=B2=20keypress=20correctly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Turns out str.isdigit() also handles ² as a digit, but int('²') causes a ValueError. Here we use `string.digits` instead, which is '0123456789'. Fixes #3743 --- qutebrowser/keyinput/basekeyparser.py | 4 +++- tests/unit/keyinput/test_basekeyparser.py | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/qutebrowser/keyinput/basekeyparser.py b/qutebrowser/keyinput/basekeyparser.py index f0f2c6f28..8161293cc 100644 --- a/qutebrowser/keyinput/basekeyparser.py +++ b/qutebrowser/keyinput/basekeyparser.py @@ -19,6 +19,8 @@ """Base class for vim-like key sequence parser.""" +import string + from PyQt5.QtCore import pyqtSignal, QObject from PyQt5.QtGui import QKeySequence @@ -136,7 +138,7 @@ class BaseKeyParser(QObject): def _match_count(self, sequence, dry_run): """Try to match a key as count.""" txt = str(sequence[-1]) # To account for sequences changed above. - if (txt.isdigit() and self._supports_count and + if (txt in string.digits and self._supports_count and not (not self._count and txt == '0')): self._debug_log("Trying match as count") assert len(txt) == 1, txt diff --git a/tests/unit/keyinput/test_basekeyparser.py b/tests/unit/keyinput/test_basekeyparser.py index 7915e2b75..135033ecd 100644 --- a/tests/unit/keyinput/test_basekeyparser.py +++ b/tests/unit/keyinput/test_basekeyparser.py @@ -320,6 +320,10 @@ class TestCount: keyparser.execute.assert_called_once_with('message-info ccc', 23) assert not keyparser._sequence + def test_superscript(self, handle_text, keyparser): + # https://github.com/qutebrowser/qutebrowser/issues/3743 + handle_text(Qt.Key_twosuperior, Qt.Key_B, Qt.Key_A) + def test_count_keystring_update(self, qtbot, handle_text, keyparser): """Make sure the keystring is updated correctly when entering count.""" with qtbot.waitSignals([keyparser.keystring_updated, From e895ee8bdc526e37d3cf95983d1a06ea0e31f87c Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 22 May 2018 12:28:55 +0200 Subject: [PATCH 28/28] Update changelog --- doc/changelog.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index a5dbbb140..fa38999b5 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -51,6 +51,7 @@ Fixed - Work around an issue in Qt 5.11 where e.g. activating JavaScript per-domain needed a manual relaod in some cases. +- Don't crash when a ² key is pressed (e.g. on AZERTY keyboards). v1.3.0 ------