From cce1c85f5aa0ab66620337de4d640e654e4279a0 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 15 Dec 2015 16:29:18 +0100 Subject: Fix MouseReleaseEvent not being sent when clicking on a context item. The context menu that appears, when right clicking in a WebEngineView, does not have a parent. On OSX if a context menu does not have a parent, a MouseReleaseEvent is not sent when an item is chosen in the menu, and thus consecutive mouse events are not handled properly. The fix consists in assiging the WebEngineView as the QML parent for the context menu that is opened. Task-number: QTBUG-44666 Change-Id: I7f79d4497c57a814866089195da1570591a6999e Reviewed-by: Joerg Bornemann --- src/webengine/api/qquickwebengineview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/webengine/api/qquickwebengineview.cpp') diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index ff2647e3e..4f99a3e81 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -178,7 +178,9 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu { Q_Q(QQuickWebEngineView); - QObject *menu = ui()->addMenu(0, QString(), data.pos); + // Assign the WebEngineView as the parent of the menu, so mouse events are properly propagated + // on OSX. + QObject *menu = ui()->addMenu(q, QString(), data.pos); if (!menu) return false; -- cgit v1.2.3