From 9c17aa1fd8e6ff4a2e3905dfd73d73f4691d8dc0 Mon Sep 17 00:00:00 2001 From: Kevin Kofler Date: Tue, 25 Apr 2017 23:54:33 +0200 Subject: [PATCH] Backport upstream fix for blank pages when a link opens in a new tab * Tue Apr 25 2017 Kevin Kofler - 5.8.0-10 - Backport upstream fix for blank pages when a link opens in a new tab --- qt5-qtwebengine.spec | 10 +++- ...source-src-5.8.0-fix-open-in-new-tab.patch | 46 +++++++++++++++++++ 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 qtwebengine-opensource-src-5.8.0-fix-open-in-new-tab.patch diff --git a/qt5-qtwebengine.spec b/qt5-qtwebengine.spec index 1c85c48..f72d08f 100644 --- a/qt5-qtwebengine.spec +++ b/qt5-qtwebengine.spec @@ -38,7 +38,7 @@ Summary: Qt5 - QtWebEngine components Name: qt5-qtwebengine Version: 5.8.0 -Release: 9%{?dist} +Release: 10%{?dist} # See LICENSE.GPL LICENSE.LGPL LGPL_EXCEPTION.txt, for details # See also http://qt-project.org/doc/qt-5.0/qtdoc/licensing.html @@ -105,7 +105,9 @@ Patch14: qtwebengine-opensource-src-5.8.0-pdfium-gcc7.patch # fix FTBFS in the WTF part of Blink/WebKit with GCC 7 Patch15: qtwebengine-opensource-src-5.8.0-wtf-gcc7.patch # FTBFS using qt < 5.8 -Patch20: qtwebengine-opensource-src-5.8.0-qt57.patch +Patch20: qtwebengine-opensource-src-5.8.0-qt57.patch +# upstream fix for blank pages when a link opens in a new tab +Patch100: qtwebengine-opensource-src-5.8.0-fix-open-in-new-tab.patch %if 0%{?fedora} && 0%{?fedora} < 25 # work around missing qt5_qtwebengine_arches macro on F24 @@ -353,6 +355,7 @@ BuildArch: noarch %patch14 -p1 -b .pdfium-gcc7 %patch15 -p1 -b .wtf-gcc7 %patch20 -p1 -b .qt57 +%patch100 -p1 -b .fix-open-in-new-tab # fix // in #include in content/renderer/gpu to avoid debugedit failure sed -i -e 's!gpu//!gpu/!g' \ src/3rdparty/chromium/content/renderer/gpu/compositor_forwarding_message_filter.cc @@ -560,6 +563,9 @@ done %changelog +* Tue Apr 25 2017 Kevin Kofler - 5.8.0-10 +- Backport upstream fix for blank pages when a link opens in a new tab + * Mon Apr 17 2017 Rex Dieter - 5.8.0-9 - +macros.qt5-qtwebengine diff --git a/qtwebengine-opensource-src-5.8.0-fix-open-in-new-tab.patch b/qtwebengine-opensource-src-5.8.0-fix-open-in-new-tab.patch new file mode 100644 index 0000000..c95a712 --- /dev/null +++ b/qtwebengine-opensource-src-5.8.0-fix-open-in-new-tab.patch @@ -0,0 +1,46 @@ +From 8e147ed3be7740092de233a2a7c67ec890069649 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20Br=C3=BCning?= +Date: Mon, 13 Mar 2017 11:13:56 +0100 +Subject: Remove stale parent connection when initializing delegate as a child + +When clicking on a blank link target, the constructor of the +RenderWidgetHostViewQtDelegateWidget instance for the newly created +view is called with the originating QWebEngineView as its parent +and will connect its removeParentBeforeParentDelete slot to the +originating view's destroyed signal. + +This leads to the situation where the delegate's parent will be set to +null when the originating view is closed, causing the view to display +only an empty widget with the actual web contents remaining live in +the background. + +This patch removes the connection to the old view when initializing +the delegate as a child of the QWebEnginePagePrivate instance. The +addition to the layout updates the parent and child relationship +between the view and the delegate internally. + +Task-number: QTBUG-58381 +Change-Id: I448380478c2bcfcfbddaee8a35caf46010e57972 +Reviewed-by: Florian Bruhin +Reviewed-by: Joerg Bornemann +--- + src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +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 e7ad5b1..14c4d72 100644 +--- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp ++++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp +@@ -163,6 +163,9 @@ void RenderWidgetHostViewQtDelegateWidget::initAsChild(WebContentsAdapterClient* + + QWebEnginePagePrivate *pagePrivate = static_cast(container); + if (pagePrivate->view) { ++ if (parentWidget()) ++ disconnect(parentWidget(), &QObject::destroyed, ++ this, &RenderWidgetHostViewQtDelegateWidget::removeParentBeforeParentDelete); + pagePrivate->view->layout()->addWidget(this); + pagePrivate->view->setFocusProxy(this); + show(); +-- +cgit v1.0-4-g1e03 +