summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-03-12 12:41:40 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-03-16 12:03:57 +0100
commit3c544a5d0d59b0533f507a6131fbbc093ed223ea (patch)
treec64d3ae8e17280350037ff1d6687ec797ca4715c /src/core/web_contents_adapter.cpp
parente7c869c225075d898cb5d20b194af4b939d2dbc1 (diff)
parentfdec85eba16d6321597e93b447bc13a611cfdd23 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r--src/core/web_contents_adapter.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 014fb6482..0f41a53cb 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -1546,7 +1546,15 @@ void WebContentsAdapter::startDragging(QObject *dragSource, const content::DropD
QObject::disconnect(onDestroyed);
if (dValid) {
if (m_webContents) {
- content::RenderViewHost *rvh = m_webContents->GetRenderViewHost();
+ // This is the quickest and (at the moment) the most safe solution to not break guest views when
+ // dropping data into them. We don't even try to support dropping into PDF input fields,
+ // since it's not working in Chrome right now.
+ content::WebContents *targetWebContents = m_webContents.get();
+ std::vector<content::WebContents *> innerWebContents = m_webContents->GetInnerWebContents();
+ if (!innerWebContents.empty())
+ targetWebContents = innerWebContents[0];
+
+ content::RenderViewHost *rvh = targetWebContents->GetRenderViewHost();
if (rvh) {
rvh->GetWidget()->DragSourceEndedAt(gfx::PointF(m_lastDragClientPos.x(), m_lastDragClientPos.y()),
gfx::PointF(m_lastDragScreenPos.x(), m_lastDragScreenPos.y()),