From 10538738e0203a35b312be3d5331a77013bbc090 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 21 Jun 2018 17:14:29 +0200 Subject: Don't depend on PyQt5.QtQuickWidgets to get RWHV Some distributions (at least FreeBSD) don't package that module, so let's not rely on it. (cherry picked from commit 62d8b5b57497da86ddbfda359ef248e2fe706695) --- qutebrowser/browser/webengine/webview.py | 10 +++++----- tests/end2end/fixtures/quteprocess.py | 3 --- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/qutebrowser/browser/webengine/webview.py b/qutebrowser/browser/webengine/webview.py index 03cdd035f..d1fdeb4e7 100644 --- a/qutebrowser/browser/webengine/webview.py +++ b/qutebrowser/browser/webengine/webview.py @@ -24,7 +24,7 @@ import functools import sip from PyQt5.QtCore import pyqtSignal, pyqtSlot, QUrl, PYQT_VERSION from PyQt5.QtGui import QPalette -from PyQt5.QtQuickWidgets import QQuickWidget +from PyQt5.QtWidgets import QWidget from PyQt5.QtWebEngineWidgets import (QWebEngineView, QWebEnginePage, QWebEngineScript) @@ -72,10 +72,10 @@ class WebEngineView(QWebEngineView): if proxy is not None: return proxy - # This should only find the RenderWidgetHostViewQtDelegateWidget, - # but not e.g. a QMenu - children = [c for c in self.findChildren(QQuickWidget) - if c.isVisible()] + # We don't want e.g. a QMenu. + rwhv_class = 'QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget' + children = [c for c in self.findChildren(QWidget) + if c.isVisible() and c.inherits(rwhv_class)] log.webview.debug("Found possibly lost focusProxy: {}" .format(children)) diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index 7d1cd2394..0c560cf51 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -361,9 +361,6 @@ class QuteProc(testprocess.Process): "Focus object changed: " "", - # Qt >= 5.11 with workarounds - "Focus object changed: " - "", ] if (log_line.category == 'ipc' and -- cgit v1.2.3-54-g00ecf