From 26e37739e2e0ac39bf2ee46fad42b19fd252b60e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 22 May 2018 23:07:31 +0200 Subject: [PATCH 1/4] Fix typo --- doc/changelog.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index fa38999b5..fc14f825a 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -50,7 +50,7 @@ Fixed ~~~~~ - Work around an issue in Qt 5.11 where e.g. activating JavaScript per-domain - needed a manual relaod in some cases. + needed a manual reload in some cases. - Don't crash when a ² key is pressed (e.g. on AZERTY keyboards). v1.3.0 From 7162f15348219d3736a8d17785d9b6e2dff49f8f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 23 May 2018 09:44:44 +0200 Subject: [PATCH 2/4] Use functools instead of a lambda for QTimer It reads nicer, and this is also speculative fix for #3896 as PyQt5 is hopefully better at disconnecting partial-objects from dead objects than it is with lambdas. --- qutebrowser/browser/webengine/webenginetab.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 3fcc58738..8722a3182 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -1035,8 +1035,9 @@ class WebEngineTab(browsertab.AbstractTab): log.config.debug( "Loading {} again because of config change".format( self._reload_url.toDisplayString())) - QTimer.singleShot(100, lambda url=self._reload_url: - self.openurl(url, predict=False)) + QTimer.singleShot(100, functools.partial(self.openurl, + self._reload_url, + predict=False)) self._reload_url = None if not qtutils.version_check('5.10', compiled=False): From 17cfb0d39c9c726bdabb53ffa98095ac4405fbd4 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 23 May 2018 21:31:18 +0200 Subject: [PATCH 3/4] Add some more logging for #3920 --- qutebrowser/browser/mouse.py | 3 +++ qutebrowser/browser/webengine/webenginetab.py | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/mouse.py b/qutebrowser/browser/mouse.py index 43d234322..5320bfa6b 100644 --- a/qutebrowser/browser/mouse.py +++ b/qutebrowser/browser/mouse.py @@ -58,6 +58,9 @@ class ChildEventFilter(QObject): 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) + elif event.type() == QEvent.ChildRemoved: + child = event.child() + log.mouse.debug("{}: removed child {}".format(obj, child)) return False diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 8722a3182..31cb1ba57 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -30,7 +30,7 @@ from PyQt5.QtCore import (pyqtSignal, pyqtSlot, Qt, QEvent, QPoint, QPointF, QUrl, QTimer) from PyQt5.QtGui import QKeyEvent, QIcon from PyQt5.QtNetwork import QAuthenticator -from PyQt5.QtWidgets import QApplication +from PyQt5.QtWidgets import QApplication, QWidget from PyQt5.QtWebEngineWidgets import QWebEnginePage, QWebEngineScript from qutebrowser.config import configdata, config @@ -41,7 +41,7 @@ from qutebrowser.browser.webengine import (webview, webengineelem, tabhistory, webenginesettings) from qutebrowser.misc import miscwidgets from qutebrowser.utils import (usertypes, qtutils, log, javascript, utils, - message, objreg, jinja, debug) + message, objreg, jinja, debug, message) _qute_scheme_handler = None @@ -1061,7 +1061,13 @@ class WebEngineTab(browsertab.AbstractTab): # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-68224 layout = self._widget.layout() count = layout.count() + children = self._widget.findChildren(QWidget) + if not count and children: + log.webview.warning("Found children not in layout: {}, " + "focus proxy {} (QTBUG-68224)".format( + children, self._widget.focusProxy())) if count > 1: + log.webview.debug("Found {} widgets! (QTBUG-68224)".format(count)) for i in range(count): item = layout.itemAt(i) if item is None: From 12e0edbcd0520c530ff18e2ddf054e570c34c35a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 24 May 2018 08:47:31 +0200 Subject: [PATCH 4/4] Fix lint --- qutebrowser/browser/webengine/webenginetab.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 31cb1ba57..4ce8b8bdd 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -41,7 +41,7 @@ from qutebrowser.browser.webengine import (webview, webengineelem, tabhistory, webenginesettings) from qutebrowser.misc import miscwidgets from qutebrowser.utils import (usertypes, qtutils, log, javascript, utils, - message, objreg, jinja, debug, message) + message, objreg, jinja, debug) _qute_scheme_handler = None @@ -1067,7 +1067,8 @@ class WebEngineTab(browsertab.AbstractTab): "focus proxy {} (QTBUG-68224)".format( children, self._widget.focusProxy())) if count > 1: - log.webview.debug("Found {} widgets! (QTBUG-68224)".format(count)) + log.webview.debug("Found {} widgets! (QTBUG-68224)" + .format(count)) for i in range(count): item = layout.itemAt(i) if item is None: