From 9725d9ce3349a86a9272ba36011da739bd12c52f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 8 Jun 2018 14:55:34 +0200 Subject: [PATCH] Exclude QMenu when trying to find the missing focusProxy --- qutebrowser/browser/webengine/webview.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/webengine/webview.py b/qutebrowser/browser/webengine/webview.py index e89d01a88..f29b67708 100644 --- a/qutebrowser/browser/webengine/webview.py +++ b/qutebrowser/browser/webengine/webview.py @@ -72,7 +72,13 @@ class WebEngineView(QWebEngineView): if proxy is not None: return proxy - children = self.findChildren(QWidget) + # We only want the RenderWidgetHostViewQtDelegateWidget + # (which is a QWidget) but not e.g. a QMenu. + # pylint: disable=unidiomatic-typecheck + children = [child for child in self.findChildren(QWidget) + if type(child) == QWidget] + # pylint: enable=unidiomatic-typecheck + if not children: return None