This commit is contained in:
Florian Bruhin 2017-02-03 23:55:14 +01:00
parent 7d1316fe03
commit 66719c5ecc
5 changed files with 12 additions and 5 deletions

View File

@ -208,6 +208,7 @@ class MouseEventFilter(QObject):
if evtype not in self._handlers: if evtype not in self._handlers:
return False return False
if obj is not self._tab.event_target(): if obj is not self._tab.event_target():
log.mouse.debug("Ignoring {} to {}".format(event.__class__.__name__, obj)) log.mouse.debug("Ignoring {} to {}".format(event.__class__.__name__,
obj))
return False return False
return self._handlers[evtype](event) return self._handlers[evtype](event)

View File

@ -393,7 +393,7 @@ class AbstractWebElement(collections.abc.MutableMapping):
"""Simulate a click on the element. """Simulate a click on the element.
Args: Args:
click_target: An usertypes.ClickTarget member, what kind of click click_target: A usertypes.ClickTarget member, what kind of click
to simulate. to simulate.
force_event: Force generating a fake mouse event. force_event: Force generating a fake mouse event.
""" """

View File

@ -25,7 +25,7 @@
from PyQt5.QtCore import QRect, Qt, QPoint from PyQt5.QtCore import QRect, Qt, QPoint
from PyQt5.QtGui import QMouseEvent from PyQt5.QtGui import QMouseEvent
from qutebrowser.utils import log, javascript, usertypes from qutebrowser.utils import log, javascript
from qutebrowser.browser import webelem from qutebrowser.browser import webelem
@ -153,9 +153,14 @@ class WebEngineElement(webelem.AbstractWebElement):
def _click_editable(self): def _click_editable(self):
# WORKAROUND for https://bugreports.qt.io/browse/QTBUG-58515 # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-58515
# pylint doesn't know about Qt.MouseEventSynthesizedBySystem
# because it was added in Qt 5.6, but we can be sure we use that with
# QtWebEngine.
# pylint: disable=no-member
ev = QMouseEvent(QMouseEvent.MouseButtonPress, QPoint(0, 0), ev = QMouseEvent(QMouseEvent.MouseButtonPress, QPoint(0, 0),
QPoint(0, 0), QPoint(0, 0), Qt.NoButton, Qt.NoButton, QPoint(0, 0), QPoint(0, 0), Qt.NoButton, Qt.NoButton,
Qt.NoModifier, Qt.MouseEventSynthesizedBySystem) Qt.NoModifier, Qt.MouseEventSynthesizedBySystem)
# pylint: enable=no-member
self._tab.send_event(ev) self._tab.send_event(ev)
# This actually "clicks" the element by calling focus() on it in JS. # This actually "clicks" the element by calling focus() on it in JS.
js_code = javascript.assemble('webelem', 'focus', self._id) js_code = javascript.assemble('webelem', 'focus', self._id)

View File

@ -27,7 +27,7 @@ import functools
from PyQt5.QtCore import pyqtSlot, Qt, QEvent, QPoint, QUrl, QTimer from PyQt5.QtCore import pyqtSlot, Qt, QEvent, QPoint, QUrl, QTimer
from PyQt5.QtGui import QKeyEvent, QIcon from PyQt5.QtGui import QKeyEvent, QIcon
# pylint: disable=no-name-in-module,import-error,useless-suppression # pylint: disable=no-name-in-module,import-error,useless-suppression
from PyQt5.QtWidgets import QOpenGLWidget, QApplication from PyQt5.QtWidgets import QApplication
from PyQt5.QtWebEngineWidgets import (QWebEnginePage, QWebEngineScript, from PyQt5.QtWebEngineWidgets import (QWebEnginePage, QWebEngineScript,
QWebEngineProfile) QWebEngineProfile)
# pylint: enable=no-name-in-module,import-error,useless-suppression # pylint: enable=no-name-in-module,import-error,useless-suppression

View File

@ -218,7 +218,8 @@ class QuteProc(testprocess.Process):
log_line.waited_for = True log_line.waited_for = True
self._is_ready('load') self._is_ready('load')
elif log_line.category == 'misc' and any(testutils.pattern_match( elif log_line.category == 'misc' and any(testutils.pattern_match(
pattern=pattern, value=log_line.message) for pattern in start_okay_messages_focus): pattern=pattern, value=log_line.message) for pattern in
start_okay_messages_focus):
self._is_ready('focus') self._is_ready('focus')
elif (log_line.category == 'init' and elif (log_line.category == 'init' and
log_line.module == 'standarddir' and log_line.module == 'standarddir' and