diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2018-07-12 13:36:57 +0200 |
---|---|---|
committer | Jüri Valdmann <juri.valdmann@qt.io> | 2018-07-13 08:33:38 +0000 |
commit | 1a70d36b8908f81710e2db9018ccb48d97749cd3 (patch) | |
tree | bf923460cc0fa2cb7d8e0142ba7bc60e512b9791 | |
parent | 136bf6d507d7aa84f1aa97ad22b56d574581e227 (diff) |
Fix enum mismatch in WebContentsAdapter::enterDrag
DragTargetDragEnter expects the 'int key_modifiers' parameter to have values
from the enum blink::WebInputEvent::Modifiers and not ui::EventFlags.
Also, contrary to the name, mouse modifiers are also expected.
Task-number: QTBUG-69231
Change-Id: I2369609775243fded563dde7675c4bc2dfc81021
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
-rw-r--r-- | src/core/web_contents_adapter.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 8fe86ddc2..57b2039ed 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -1526,24 +1526,6 @@ static void fillDropDataFromMimeData(content::DropData *dropData, const QMimeDat } } -void WebContentsAdapter::enterDrag(QDragEnterEvent *e, const QPointF &screenPos) -{ - Q_D(WebContentsAdapter); - CHECK_INITIALIZED(); - - if (!d->currentDropData) { - // The drag originated outside the WebEngineView. - d->currentDropData.reset(new content::DropData); - fillDropDataFromMimeData(d->currentDropData.get(), e->mimeData()); - } - - content::RenderViewHost *rvh = d->webContents->GetRenderViewHost(); - rvh->GetWidget()->FilterDropData(d->currentDropData.get()); - rvh->GetWidget()->DragTargetDragEnter(*d->currentDropData, toGfx(e->posF()), toGfx(screenPos), - toWeb(e->possibleActions()), - flagsFromModifiers(e->keyboardModifiers())); -} - Qt::DropAction toQt(blink::WebDragOperation op) { if (op & blink::kWebDragOperationCopy) @@ -1581,6 +1563,24 @@ static int toWeb(Qt::KeyboardModifiers modifiers) return result; } +void WebContentsAdapter::enterDrag(QDragEnterEvent *e, const QPointF &screenPos) +{ + Q_D(WebContentsAdapter); + CHECK_INITIALIZED(); + + if (!d->currentDropData) { + // The drag originated outside the WebEngineView. + d->currentDropData.reset(new content::DropData); + fillDropDataFromMimeData(d->currentDropData.get(), e->mimeData()); + } + + content::RenderViewHost *rvh = d->webContents->GetRenderViewHost(); + rvh->GetWidget()->FilterDropData(d->currentDropData.get()); + rvh->GetWidget()->DragTargetDragEnter(*d->currentDropData, toGfx(e->posF()), toGfx(screenPos), + toWeb(e->possibleActions()), + toWeb(e->mouseButtons()) | toWeb(e->keyboardModifiers())); +} + Qt::DropAction WebContentsAdapter::updateDragPosition(QDragMoveEvent *e, const QPointF &screenPos) { Q_D(WebContentsAdapter); |