diff options
author | Michael BrĂ¼ning <michael.bruning@qt.io> | 2018-08-20 16:26:03 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-08-21 15:18:19 +0200 |
commit | be18c1dcfa68328acdf11e0a534749d9a5d75f8b (patch) | |
tree | 53a7b347d2771f4502338ac973a80a37edacdee7 /src/core/render_widget_host_view_qt.cpp | |
parent | b74e93a9b07243da4f3d2784cde49916de455364 (diff) | |
parent | e56dd7e37ea96c4ba1354e319bdaa9d01c401747 (diff) |
Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
.qmake.conf
configure.json
examples/webenginewidgets/markdowneditor/resources/3rdparty/marked.js
examples/webenginewidgets/markdowneditor/resources/3rdparty/qt_attribution.json
examples/webenginewidgets/markdowneditor/resources/markdowneditor.qrc
mkspecs/features/platform.prf
src/3rdparty
src/core/media_capture_devices_dispatcher.cpp
src/core/net/url_request_context_getter_qt.cpp
src/core/net/url_request_context_getter_qt.h
src/core/web_contents_adapter.cpp
Change-Id: I467133ba455b1f85f6bb61793794c31cb1094541
Diffstat (limited to 'src/core/render_widget_host_view_qt.cpp')
-rw-r--r-- | src/core/render_widget_host_view_qt.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 3e5d9bc4b..e706c5869 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -1073,7 +1073,11 @@ bool RenderWidgetHostViewQt::forwardEvent(QEvent *event) case QEvent::MouseMove: // Skip second MouseMove event when a window is being adopted, so that Chromium // can properly handle further move events. - if (m_adapterClient->isBeingAdopted()) + // Also make sure the adapter client exists to prevent a null pointer dereference, + // because it's possible for a QWebEnginePagePrivate (adapter) instance to be destroyed, + // and then the OS (observed on Windows) might still send mouse move events to a still + // existing popup RWHVQDW instance. + if (m_adapterClient && m_adapterClient->isBeingAdopted()) return false; handleMouseEvent(static_cast<QMouseEvent*>(event)); break; @@ -1091,12 +1095,14 @@ bool RenderWidgetHostViewQt::forwardEvent(QEvent *event) case QEvent::TouchCancel: handleTouchEvent(static_cast<QTouchEvent*>(event)); break; +#if QT_CONFIG(tabletevent) case QEvent::TabletPress: Focus(); // Fall through. case QEvent::TabletRelease: case QEvent::TabletMove: handleTabletEvent(static_cast<QTabletEvent*>(event)); break; +#endif #ifndef QT_NO_GESTURES case QEvent::NativeGesture: handleGestureEvent(static_cast<QNativeGestureEvent *>(event)); @@ -1172,6 +1178,15 @@ QVariant RenderWidgetHostViewQt::inputMethodQuery(Qt::InputMethodQuery query) } } +void RenderWidgetHostViewQt::closePopup() +{ + // We notify the popup to be closed by telling it that it lost focus. WebKit does the rest + // (hiding the widget and automatic memory cleanup via + // RenderWidget::CloseWidgetSoon() -> RenderWidgetHostImpl::ShutdownAndDestroyWidget(true). + m_host->SetActive(false); + m_host->Blur(); +} + void RenderWidgetHostViewQt::ProcessAckedTouchEvent(const content::TouchEventWithLatencyInfo &touch, content::InputEventAckState ack_result) { Q_UNUSED(touch); const bool eventConsumed = ack_result == content::INPUT_EVENT_ACK_STATE_CONSUMED; @@ -1617,10 +1632,12 @@ void RenderWidgetHostViewQt::handleTouchEvent(QTouchEvent *ev) } } +#if QT_CONFIG(tabletevent) void RenderWidgetHostViewQt::handleTabletEvent(QTabletEvent *event) { handlePointerEvent<QTabletEvent>(event); } +#endif template<class T> void RenderWidgetHostViewQt::handlePointerEvent(T *event) |