diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-03-12 12:41:40 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-03-16 12:03:57 +0100 |
commit | 3c544a5d0d59b0533f507a6131fbbc093ed223ea (patch) | |
tree | c64d3ae8e17280350037ff1d6687ec797ca4715c /src/core/web_contents_adapter.cpp | |
parent | e7c869c225075d898cb5d20b194af4b939d2dbc1 (diff) | |
parent | fdec85eba16d6321597e93b447bc13a611cfdd23 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I0dd7c64669f4b130047a4a3836f62f7ee5b5f8d9
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 10 |
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()), |