diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-30 12:48:17 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-30 12:48:17 +0200 |
commit | 881da28418d380042aa95a97f0cbd42560a64f7c (patch) | |
tree | a794dff3274695e99c651902dde93d934ea7a5af /Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp | |
parent | 7e104c57a70fdf551bb3d22a5d637cdcbc69dbea (diff) | |
parent | 0fcedcd17cc00d3dd44c718b3cb36c1033319671 (diff) | |
download | qtwebkit-881da28418d380042aa95a97f0cbd42560a64f7c.tar.gz |
Merge 'wip/next' into dev
Change-Id: Iff9ee5e23bb326c4371ec8ed81d56f2f05d680e9
Diffstat (limited to 'Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp')
-rw-r--r-- | Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp index 8e7c5c221..d05649736 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp +++ b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp @@ -184,11 +184,11 @@ void QtWebPageEventHandler::handleHoverMoveEvent(QHoverEvent* ev) void QtWebPageEventHandler::handleDragEnterEvent(QDragEnterEvent* ev) { - m_webPageProxy->resetDragOperation(); + m_webPageProxy->resetCurrentDragInformation(); QTransform fromItemTransform = m_webPage->transformFromItem(); // FIXME: Should not use QCursor::pos() DragData dragData(ev->mimeData(), fromItemTransform.map(ev->pos()), QCursor::pos(), dropActionToDragOperation(ev->possibleActions())); - m_webPageProxy->dragEntered(&dragData); + m_webPageProxy->dragEntered(dragData); ev->acceptProposedAction(); } @@ -198,8 +198,8 @@ void QtWebPageEventHandler::handleDragLeaveEvent(QDragLeaveEvent* ev) // FIXME: Should not use QCursor::pos() DragData dragData(0, IntPoint(), QCursor::pos(), DragOperationNone); - m_webPageProxy->dragExited(&dragData); - m_webPageProxy->resetDragOperation(); + m_webPageProxy->dragExited(dragData); + m_webPageProxy->resetCurrentDragInformation(); ev->setAccepted(accepted); } @@ -211,9 +211,9 @@ void QtWebPageEventHandler::handleDragMoveEvent(QDragMoveEvent* ev) QTransform fromItemTransform = m_webPage->transformFromItem(); // FIXME: Should not use QCursor::pos() DragData dragData(ev->mimeData(), fromItemTransform.map(ev->pos()), QCursor::pos(), dropActionToDragOperation(ev->possibleActions())); - m_webPageProxy->dragUpdated(&dragData); - ev->setDropAction(dragOperationToDropAction(m_webPageProxy->dragSession().operation)); - if (m_webPageProxy->dragSession().operation != DragOperationNone) + m_webPageProxy->dragUpdated(dragData); + ev->setDropAction(dragOperationToDropAction(m_webPageProxy->currentDragOperation())); + if (m_webPageProxy->currentDragOperation() != DragOperationNone) ev->accept(); ev->setAccepted(accepted); @@ -227,8 +227,8 @@ void QtWebPageEventHandler::handleDropEvent(QDropEvent* ev) DragData dragData(ev->mimeData(), fromItemTransform.map(ev->pos()), QCursor::pos(), dropActionToDragOperation(ev->possibleActions())); SandboxExtension::Handle handle; SandboxExtension::HandleArray sandboxExtensionForUpload; - m_webPageProxy->performDrag(&dragData, String(), handle, sandboxExtensionForUpload); - ev->setDropAction(dragOperationToDropAction(m_webPageProxy->dragSession().operation)); + m_webPageProxy->performDragOperation(dragData, String(), handle, sandboxExtensionForUpload); + ev->setDropAction(dragOperationToDropAction(m_webPageProxy->currentDragOperation())); ev->accept(); ev->setAccepted(accepted); @@ -261,12 +261,14 @@ void QtWebPageEventHandler::deactivateTapHighlight() void QtWebPageEventHandler::handleSingleTapEvent(const QTouchEvent::TouchPoint& point) { +#if ENABLE(QT_GESTURE_EVENTS) deactivateTapHighlight(); m_postponeTextInputStateChanged = true; QTransform fromItemTransform = m_webPage->transformFromItem(); - WebGestureEvent gesture(WebEvent::GestureSingleTap, fromItemTransform.map(point.pos()).toPoint(), point.screenPos().toPoint(), WebEvent::Modifiers(0), 0, IntSize(point.rect().size().toSize()), FloatPoint(0, 0)); + WebGestureEvent gesture(WebEvent::GestureSingleTap, fromItemTransform.map(point.pos()).toPoint(), point.screenPos().toPoint(), WebEvent::Modifiers(0), 0, IntSize(point.rect().size().toSize())); m_webPageProxy->handleGestureEvent(gesture); +#endif } void QtWebPageEventHandler::handleDoubleTapEvent(const QTouchEvent::TouchPoint& point) @@ -300,12 +302,12 @@ void QtWebPageEventHandler::handleKeyReleaseEvent(QKeyEvent* ev) void QtWebPageEventHandler::handleFocusInEvent(QFocusEvent*) { - m_webPageProxy->viewStateDidChange(WebPageProxy::ViewIsFocused | WebPageProxy::ViewWindowIsActive); + m_webPageProxy->viewStateDidChange(ViewState::IsFocused | ViewState::WindowIsActive); } void QtWebPageEventHandler::handleFocusLost() { - m_webPageProxy->viewStateDidChange(WebPageProxy::ViewIsFocused | WebPageProxy::ViewWindowIsActive); + m_webPageProxy->viewStateDidChange(ViewState::IsFocused | ViewState::WindowIsActive); } void QtWebPageEventHandler::setViewportController(PageViewportControllerClientQt* controller) @@ -446,6 +448,7 @@ void QtWebPageEventHandler::handleWillSetInputMethodState() void QtWebPageEventHandler::doneWithGestureEvent(const WebGestureEvent& event, bool wasEventHandled) { +#if ENABLE(QT_GESTURE_EVENTS) if (event.type() != WebEvent::GestureSingleTap) return; @@ -455,6 +458,7 @@ void QtWebPageEventHandler::doneWithGestureEvent(const WebGestureEvent& event, b return; updateTextInputState(); +#endif } void QtWebPageEventHandler::handleInputEvent(const QInputEvent* event) @@ -562,7 +566,9 @@ void QtWebPageEventHandler::handleInputEvent(const QInputEvent* event) // Early return since this was a touch-end event. return; - } else if (activeTouchPointCount == 1) { + } + + if (activeTouchPointCount == 1) { // If the pinch gesture recognizer was previously in active state the content might // be out of valid zoom boundaries, thus we need to finish the pinch gesture here. // This will resume the content to valid zoom levels before the pan gesture is started. @@ -638,4 +644,3 @@ void QtWebPageEventHandler::startDrag(const WebCore::DragData& dragData, PassRef } // namespace WebKit #include "moc_QtWebPageEventHandler.cpp" - |