From b7a4918f89debdf4178f4eb3bdbd065d55ebac1e Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 16 Apr 2018 13:21:52 +0200 Subject: Consider various resources fallback paths on macOS framework build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building a macOS framework build, paths like process path, resources path, icu path, etc are determined solely by the existence of the WebEngineCore.framework bundle, which is found using its bundle id. There might be cases when the bundle is not present. For example when deploying a WebEngine PySide2 application using PyInstaller, the layout of the copied files is changed. In this case considering application path (current application directory) as a candidate path, as well as the rest of the candidates paths would be useful. Change-Id: Ide3fd62756659ec8d42c5629c0efa1d60602ed80 Reviewed-by: Michael Brüning --- src/core/web_engine_library_info.cpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp index 35b139602..515f763d2 100644 --- a/src/core/web_engine_library_info.cpp +++ b/src/core/web_engine_library_info.cpp @@ -163,9 +163,9 @@ QString subProcessPath() #else candidatePaths << QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath) % QLatin1Char('/') % processBinary; +#endif candidatePaths << QCoreApplication::applicationDirPath() % QLatin1Char('/') % processBinary; -#endif } Q_FOREACH (const QString &candidate, candidatePaths) { @@ -185,11 +185,13 @@ QString subProcessPath() QString localesPath() { + static bool initialized = false; + static QString potentialLocalesPath = #if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) - return getResourcesPath(frameworkBundle()) % QLatin1String("/qtwebengine_locales"); + getResourcesPath(frameworkBundle()) % QLatin1String("/qtwebengine_locales"); #else - static bool initialized = false; - static QString potentialLocalesPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath) % QDir::separator() % QLatin1String("qtwebengine_locales"); + QLibraryInfo::location(QLibraryInfo::TranslationsPath) % QDir::separator() % QLatin1String("qtwebengine_locales"); +#endif if (!initialized) { initialized = true; @@ -204,7 +206,6 @@ QString localesPath() } return potentialLocalesPath; -#endif } #if BUILDFLAG(ENABLE_SPELLCHECK) @@ -257,11 +258,13 @@ QString dictionariesPath() QString icuDataPath() { + static bool initialized = false; + static QString potentialResourcesPath = #if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) - return getResourcesPath(frameworkBundle()); + getResourcesPath(frameworkBundle()); #else - static bool initialized = false; - static QString potentialResourcesPath = QLibraryInfo::location(QLibraryInfo::DataPath) % QLatin1String("/resources"); + QLibraryInfo::location(QLibraryInfo::DataPath) % QLatin1String("/resources"); +#endif if (!initialized) { initialized = true; if (!QFileInfo::exists(potentialResourcesPath % QLatin1String("/icudtl.dat"))) { @@ -279,16 +282,17 @@ QString icuDataPath() } return potentialResourcesPath; -#endif } QString resourcesDataPath() { + static bool initialized = false; + static QString potentialResourcesPath = #if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) - return getResourcesPath(frameworkBundle()); + getResourcesPath(frameworkBundle()); #else - static bool initialized = false; - static QString potentialResourcesPath = QLibraryInfo::location(QLibraryInfo::DataPath) % QLatin1String("/resources"); + QLibraryInfo::location(QLibraryInfo::DataPath) % QLatin1String("/resources"); +#endif if (!initialized) { initialized = true; if (!QFileInfo::exists(potentialResourcesPath % QLatin1String("/qtwebengine_resources.pak"))) { @@ -306,7 +310,6 @@ QString resourcesDataPath() } return potentialResourcesPath; -#endif } } // namespace -- cgit v1.2.3 From c1a01e2a07934f1c051780a02324cb84c0f1d168 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 16 Apr 2018 16:00:44 +0200 Subject: Fix focus after hide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We are not supposed to set the QWidget as non-visible, this removes the widget from layout and focus, and no other QWidget does that on minimize, instead just set qquickitem as non visible. Task-number: QTBUG-65595 Change-Id: Iefb52243229d11879a7a38c641084c266eef2207 Reviewed-by: Michael Brüning --- src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp index 9e2f6ed99..16ea216f2 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp @@ -269,6 +269,7 @@ void RenderWidgetHostViewQtDelegateWidget::unlockMouse() void RenderWidgetHostViewQtDelegateWidget::show() { + m_rootItem->setVisible(true); // Check if we're attached to a QWebEngineView, we don't // want to show anything else than popups as top-level. if (parent() || m_isPopup) { @@ -278,12 +279,12 @@ void RenderWidgetHostViewQtDelegateWidget::show() void RenderWidgetHostViewQtDelegateWidget::hide() { - QQuickWidget::hide(); + m_rootItem->setVisible(false); } bool RenderWidgetHostViewQtDelegateWidget::isVisible() const { - return QQuickWidget::isVisible(); + return QQuickWidget::isVisible() && m_rootItem->isVisible(); } QWindow* RenderWidgetHostViewQtDelegateWidget::window() const -- cgit v1.2.3 From f55df96ab51e590f73a7878742662758c1c4369b Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 17 Apr 2018 17:02:30 +0200 Subject: Examples: Name signal arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use a function declaration for all signal handlers that take at least one argument. Directly referencing the signal values is less robust and arguably too much magic. Change-Id: I49a48e336bdc2149643770b978826884515cc4ad Reviewed-by: Jüri Valdmann Reviewed-by: Michael Brüning --- .../webengine/quicknanobrowser/BrowserDialog.qml | 2 +- .../webengine/quicknanobrowser/BrowserWindow.qml | 33 ++++++++++++++-------- .../webengine/recipebrowser/resources/qml/main.qml | 6 ++-- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/examples/webengine/quicknanobrowser/BrowserDialog.qml b/examples/webengine/quicknanobrowser/BrowserDialog.qml index 770cfee6a..6b0b3acd6 100644 --- a/examples/webengine/quicknanobrowser/BrowserDialog.qml +++ b/examples/webengine/quicknanobrowser/BrowserDialog.qml @@ -64,7 +64,7 @@ Window { id: webView anchors.fill: parent - onGeometryChangeRequested: { + onGeometryChangeRequested: function(geometry) { window.x = geometry.x window.y = geometry.y window.width = geometry.width diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webengine/quicknanobrowser/BrowserWindow.qml index 5e98997ee..5693ffccc 100644 --- a/examples/webengine/quicknanobrowser/BrowserWindow.qml +++ b/examples/webengine/quicknanobrowser/BrowserWindow.qml @@ -206,8 +206,12 @@ ApplicationWindow { enabled: model.offset } - onObjectAdded: historyMenu.insertItem(index, object) - onObjectRemoved: historyMenu.removeItem(object) + onObjectAdded: function(index, object) { + historyMenu.insertItem(index, object) + } + onObjectRemoved: function(index, object) { + historyMenu.removeItem(object) + } } } } @@ -291,14 +295,18 @@ ApplicationWindow { text: "Off The Record" checkable: true checked: currentWebView.profile.offTheRecord - onToggled: currentWebView.profile = checked ? otrProfile : defaultProfile; + onToggled: function(checked) { + currentWebView.profile = checked ? otrProfile : defaultProfile; + } } MenuItem { id: httpDiskCacheEnabled text: "HTTP Disk Cache" checkable: !currentWebView.profile.offTheRecord checked: (currentWebView.profile.httpCacheType === WebEngineProfile.DiskHttpCache) - onToggled: currentWebView.profile.httpCacheType = checked ? WebEngineProfile.DiskHttpCache : WebEngineProfile.MemoryHttpCache + onToggled: function(checked) { + currentWebView.profile.httpCacheType = checked ? WebEngineProfile.DiskHttpCache : WebEngineProfile.MemoryHttpCache; + } } MenuItem { id: autoLoadIconsForPage @@ -368,7 +376,7 @@ ApplicationWindow { id: webEngineView focus: true - onLinkHovered: { + onLinkHovered: function(hoveredUrl) { if (hoveredUrl == "") resetStatusText.start(); else { @@ -400,12 +408,12 @@ ApplicationWindow { settings.touchIconsEnabled: appSettings.touchIconsEnabled settings.webRTCPublicInterfacesOnly: appSettings.webRTCPublicInterfacesOnly - onCertificateError: { + onCertificateError: function(error) { error.defer(); sslDialog.enqueue(error); } - onNewViewRequested: { + onNewViewRequested: function(request) { if (!request.userInitiated) print("Warning: Blocked a popup window."); else if (request.destination == WebEngineView.NewViewInTab) { @@ -424,7 +432,7 @@ ApplicationWindow { } } - onFullScreenRequested: { + onFullScreenRequested: function(request) { if (request.toggleOn) { webEngineView.state = "FullScreen"; browserWindow.previousVisibility = browserWindow.visibility; @@ -438,19 +446,20 @@ ApplicationWindow { request.accept(); } - onQuotaRequested: { + onQuotaRequested: function(request) { if (request.requestedSize <= 5 * 1024 * 1024) request.accept(); else request.reject(); } - onRegisterProtocolHandlerRequested: { - print("accepting registerProtocolHandler request for " + request.scheme + " from " + request.origin); + onRegisterProtocolHandlerRequested: function(request) { + console.log("accepting registerProtocolHandler request for " + + request.scheme + " from " + request.origin); request.accept(); } - onRenderProcessTerminated: { + onRenderProcessTerminated: function(terminationStatus, exitCode) { var status = ""; switch (terminationStatus) { case WebEngineView.NormalTerminationStatus: diff --git a/examples/webengine/recipebrowser/resources/qml/main.qml b/examples/webengine/recipebrowser/resources/qml/main.qml index 899d307cf..2639b6b5d 100644 --- a/examples/webengine/recipebrowser/resources/qml/main.qml +++ b/examples/webengine/recipebrowser/resources/qml/main.qml @@ -99,7 +99,9 @@ ApplicationWindow { Layout.fillHeight: true focus: true KeyNavigation.tab: webView - onRecipeSelected: webView.showRecipe(url) + onRecipeSelected: function(url) { + webView.showRecipe(url) + } } WebEngineView { @@ -118,7 +120,7 @@ ApplicationWindow { } property bool firstLoadComplete: false - onLoadingChanged: { + onLoadingChanged: function(loadRequest) { if (loadRequest.status === WebEngineView.LoadSucceededStatus && !firstLoadComplete) { // Debounce the showing of the web content, so images are more likely -- cgit v1.2.3 From 7e4dfecd07a4f4d43c9e9ac30a5441ae593f9854 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 17 Apr 2018 17:44:38 +0200 Subject: Examples: Use === where possible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This silences QtC warnings. Change-Id: Ia5580379a8ace01274265b3688cc267aa3540210 Reviewed-by: Jüri Valdmann Reviewed-by: Michael Brüning --- examples/webengine/quicknanobrowser/BrowserWindow.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webengine/quicknanobrowser/BrowserWindow.qml index 5693ffccc..fc9cd0253 100644 --- a/examples/webengine/quicknanobrowser/BrowserWindow.qml +++ b/examples/webengine/quicknanobrowser/BrowserWindow.qml @@ -377,7 +377,7 @@ ApplicationWindow { focus: true onLinkHovered: function(hoveredUrl) { - if (hoveredUrl == "") + if (hoveredUrl === "") resetStatusText.start(); else { resetStatusText.stop(); @@ -416,14 +416,14 @@ ApplicationWindow { onNewViewRequested: function(request) { if (!request.userInitiated) print("Warning: Blocked a popup window."); - else if (request.destination == WebEngineView.NewViewInTab) { + else if (request.destination === WebEngineView.NewViewInTab) { var tab = tabs.createEmptyTab(currentWebView.profile); tabs.currentIndex = tabs.count - 1; request.openIn(tab.item); - } else if (request.destination == WebEngineView.NewViewInBackgroundTab) { + } else if (request.destination === WebEngineView.NewViewInBackgroundTab) { var backgroundTab = tabs.createEmptyTab(currentWebView.profile); request.openIn(backgroundTab.item); - } else if (request.destination == WebEngineView.NewViewInDialog) { + } else if (request.destination === WebEngineView.NewViewInDialog) { var dialog = applicationRoot.createDialog(currentWebView.profile); request.openIn(dialog.currentWebView); } else { -- cgit v1.2.3 From 9861ce1ba35bbc29f20b65853e17b426c804c87c Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 19 Apr 2018 13:43:10 +0200 Subject: Update Chromium MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes: 3c5150686978 Remove NOTREACHED in ScreenWin::GetNativeWindowFromHWND c3a7eab76f70 [Backport] Blockfile cache: fix sparse + evict reentrancy problem, take 2. cdae16717515 [Backport] [MemCache] Fix bug while iterating LRU list in eviction 107477bf1cf4 Pass virtual url of data url request back to the UI bf10f2f32a33 Don't create undeserializable mojo origins 04c37e5d545f [Backport] [wasm] Use guard pages for minicage 66c763feb029 [Backport] Merged: [wasm] do not reuse externalized backing stores when growing 5ef6d51aa222 [Backport] Copy visible_pages_ when iterating over it. d16c1774d1ac [Backport] Skip Service workers in requests for mime handler plugins af49c0deab15 [Backport] Fix possible overflows in hair line path renderer vertex counts de120c712b75 [Backport] service worker: Disallow interception for EMBED and OBJECT requests. Task-number: QTBUG-67800 Change-Id: I421d37a303f84dfdd8547c294ac0731ed9eacac7 Reviewed-by: Michael Brüning --- src/3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty b/src/3rdparty index e173cb17d..de120c712 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit e173cb17d97aa3c2065189275c85db79eb7d1748 +Subproject commit de120c712b755a45687b4f3a7fd01bb7d3346698 -- cgit v1.2.3