Commit 7b279882 authored by Michal Klocek's avatar Michal Klocek Committed by Kai Koehne
Browse files

Disable qtquickcontrols context menu on eglfs


Qt Quick Controls 1 always creates "native" windows
for popups, however it does not check if the platform
can support creating "native" windows. As a workaround
disable context menu until Qt Quick Controls 2 are
in place.

Task-number: QTBUG-53467
Change-Id: Iea32e19f256f3d7e81a61e23f7da64dfc7ec660d
Reviewed-by: default avatarAllan Sandfeld Jensen <allan.jensen@qt.io>
Showing with 12 additions and 0 deletions
......@@ -115,6 +115,8 @@ QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate()
, m_dpiScale(1.0)
, m_backgroundColor(Qt::white)
, m_defaultZoomFactor(1.0)
// QTBUG-53467
, m_menuEnabled(true)
{
// The gold standard for mobile web content is 160 dpi, and the devicePixelRatio expected
// is the (possibly quantized) ratio of device dpi to 160 dpi.
......@@ -132,6 +134,8 @@ QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate()
// 1x, 2x, 3x etc assets that fit an integral number of pixels.
setDevicePixelRatio(qMax(1, qRound(webPixelRatio)));
}
if (platform == QLatin1Literal("eglfs"))
m_menuEnabled = false;
#ifndef QT_NO_ACCESSIBILITY
QAccessible::installFactory(&webAccessibleFactory);
#endif // QT_NO_ACCESSIBILITY
......@@ -182,6 +186,12 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu
{
Q_Q(QQuickWebEngineView);
if (!m_menuEnabled) {
qWarning("You are trying to open context menu on eglfs backend, which is not currently supported\n"
"See QTBUG-53467.");
return false;
}
// 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);
......
......@@ -215,6 +215,8 @@ private:
qreal m_dpiScale;
QColor m_backgroundColor;
qreal m_defaultZoomFactor;
// QTBUG-53467
bool m_menuEnabled;
};
#ifndef QT_NO_ACCESSIBILITY
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment