From c9cd47b5b11bb23c043df7f997038dc7a085ee6e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 6 Mar 2018 07:38:01 +0100 Subject: [PATCH] Also clear favicons when possible with QtWebEngine See #3469 --- qutebrowser/browser/webengine/webenginetab.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 170650351..c9e58e69e 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -28,7 +28,7 @@ import html as html_utils import sip from PyQt5.QtCore import (pyqtSignal, pyqtSlot, Qt, QEvent, QPoint, QPointF, QUrl, QTimer) -from PyQt5.QtGui import QKeyEvent +from PyQt5.QtGui import QKeyEvent, QIcon from PyQt5.QtNetwork import QAuthenticator from PyQt5.QtWidgets import QApplication from PyQt5.QtWebEngineWidgets import QWebEnginePage, QWebEngineScript @@ -923,6 +923,13 @@ class WebEngineTab(browsertab.AbstractTab): self.openurl(url)) self._reload_url = None + if not qtutils.version_check('5.10', compiled=False): + # We can't do this when we have the loadFinished workaround as that + # sometimes clears icons without loading a new page. + # In general, this is handled by Qt, but when loading takes long, + # the old icon is still displayed. + self.icon_changed.emit(QIcon()) + @pyqtSlot(QUrl) def _on_predicted_navigation(self, url): """If we know we're going to visit an URL soon, change the settings."""