summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/api/qwebenginepage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webenginewidgets/api/qwebenginepage.cpp')
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index bb8babd7a..61feec244 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -185,6 +185,7 @@ QWebEnginePagePrivate::QWebEnginePagePrivate(QWebEngineProfile *_profile)
, view(0)
, isLoading(false)
, scriptCollection(new QWebEngineScriptCollectionPrivate(browserContextAdapter()->userScriptController(), adapter.data()))
+ , m_isBeingAdopted(false)
{
memset(actions, 0, sizeof(actions));
}
@@ -298,7 +299,20 @@ void QWebEnginePagePrivate::adoptNewWindow(WebContentsAdapter *newWebContents, W
{
Q_Q(QWebEnginePage);
Q_UNUSED(userGesture);
+
QWebEnginePage *newPage = q->createWindow(toWindowType(disposition));
+
+ // Mark the new page as being in the process of being adopted, so that a second mouse move event
+ // sent by newWebContents->initialize() gets filtered in RenderWidgetHostViewQt::forwardEvent.
+ // The first mouse move event is being sent by q->createWindow(). This is necessary because
+ // Chromium does not get a mouse move acknowledgment message between the two events, and
+ // InputRouterImpl::ProcessMouseAck is not executed, thus all subsequent mouse move events
+ // get coalesced together, and don't get processed at all.
+ // The mouse move events are actually sent as a result of show() being called on
+ // RenderWidgetHostViewQtDelegateWidget, both when creating the window and when initialize is
+ // called.
+ newPage->d_func()->m_isBeingAdopted = true;
+
// Overwrite the new page's WebContents with ours.
if (newPage && newPage->d_func() != this) {
newPage->d_func()->adapter = newWebContents;
@@ -306,6 +320,14 @@ void QWebEnginePagePrivate::adoptNewWindow(WebContentsAdapter *newWebContents, W
if (!initialGeometry.isEmpty())
emit newPage->geometryChangeRequested(initialGeometry);
}
+
+ // Page has finished the adoption process.
+ newPage->d_func()->m_isBeingAdopted = false;
+}
+
+bool QWebEnginePagePrivate::isBeingAdopted()
+{
+ return m_isBeingAdopted;
}
void QWebEnginePagePrivate::close()