From 31a1e91866dd11e08edaebac33a7844a83d33393 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 12 May 2014 08:28:44 +0200 Subject: [PATCH] Make hitTestResult work with frames correctly --- TODO | 2 -- qutebrowser/widgets/webview.py | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index 2ad90cad7..70ce0a099 100644 --- a/TODO +++ b/TODO @@ -77,8 +77,6 @@ Bugs - Hinting problems on http://wiki.gentoo.org/wiki/Lenovo_ThinkPad_T440s (top navbar, e.g. lists, etc.) -- clicking on text fields at https://bugreports.qt-project.org/secure/Dashboard.jspa doesn't go into insert mode. (because of iframes?) - - scroll_page doesn't care about always visible bars, so content gets hidden e.g. http://www.mtb-news.de/forum/t/welcher-schuh-five-ten-vs-oneal.529148/ diff --git a/qutebrowser/widgets/webview.py b/qutebrowser/widgets/webview.py index d47f2984c..250aadc7e 100644 --- a/qutebrowser/widgets/webview.py +++ b/qutebrowser/widgets/webview.py @@ -358,7 +358,10 @@ class WebView(QWebView): # sometimes. logging.debug("Clicked at {} but frame is None!".format(pos)) return super().mousePressEvent(e) - pos -= frame.geometry().topLeft() + # You'd think we have to subtract frame.geometry().topLeft() from the + # position, but it seems QWebFrame::hitTestContent wants a position + # relative to the QWebView, not to the frame. This makes no sense to + # me, but it works this way. hitresult = frame.hitTestContent(pos) if self._is_editable(hitresult): logging.debug("Clicked editable element!")