Handle multiple visible children when finding lost focusProxy

When we click a QTBUG link (to open in a new tab) from Qt's codereview, we get
two RWHV objects which both are visible.

Experimenting with .setEnabled(False) it looks like it's (hopefully always...)
the last one which is the one to use.
This commit is contained in:
Florian Bruhin 2018-06-11 21:43:27 +02:00
parent c328d54ebe
commit 67c67db230

View File

@ -79,11 +79,7 @@ class WebEngineView(QWebEngineView):
log.webview.debug("Found possibly lost focusProxy: {}"
.format(children))
if not children:
return None
assert len(children) == 1, children
return children[0]
return children[-1] if children else None
def shutdown(self):
self.page().shutdown()