Fix scrollbar click bug

This commit is contained in:
Florian Bruhin 2014-05-08 11:50:46 +02:00
parent 295ed2421a
commit 586455bbad

View File

@ -315,9 +315,11 @@ class WebView(QWebView):
pos = e.pos()
frame = self.page_.frameAt(pos)
if frame is None:
# I don't know why this would happen, but it did.
logging.warn("Clicked at {} but frame is None!".format(pos))
return
# This happens when we click inside the webview, but not actually
# on the QWebPage - for example when clicking the scrollbar
# sometimes.
logging.debug("Clicked at {} but frame is None!".format(pos))
return super().mousePressEvent(e)
pos -= frame.geometry().topLeft()
hitresult = frame.hitTestContent(pos)
if self._is_editable(hitresult):