From: Stefan Strogin Date: Wed, 27 May 2020 16:13:16 +0000 (+0300) Subject: www-client/qutebrowser: add patch to fix session breakage with Qt 5.15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1ea73a813f311897ff6ed9fe4bdceaf36bb24213;p=gentoo.git www-client/qutebrowser: add patch to fix session breakage with Qt 5.15 See also: https://github.com/qutebrowser/qutebrowser/issues/5359 Package-Manager: Portage-2.3.100, Repoman-2.3.22 Signed-off-by: Stefan Strogin --- diff --git a/www-client/qutebrowser/files/qutebrowser-1.11.1-session-restore.patch b/www-client/qutebrowser/files/qutebrowser-1.11.1-session-restore.patch new file mode 100644 index 000000000000..060c94eee6b4 --- /dev/null +++ b/www-client/qutebrowser/files/qutebrowser-1.11.1-session-restore.patch @@ -0,0 +1,45 @@ +From 22e15acc1e617174a9fde3e53100a1b71ca7f462 Mon Sep 17 00:00:00 2001 +From: Florian Bruhin +Date: Tue, 26 May 2020 16:48:00 +0200 +Subject: [PATCH] Update Qt 5.15 session workaround for lazy_restore + +See #5359 + +(cherry picked from commit 093a454bf4e386eda8715bc3ea2b217760d5f070) +Upstream-Status: Accepted +[https://github.com/qutebrowser/qutebrowser/commit/093a454bf4e386eda8715bc3ea2b217760d5f070 +expected in v1.12.0] +--- + qutebrowser/browser/webengine/webenginetab.py | 6 +++++- + qutebrowser/html/warning-sessions.html | 1 + + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py +index 647fa60abc..f61404f4ea 100644 +--- a/qutebrowser/browser/webengine/webenginetab.py ++++ b/qutebrowser/browser/webengine/webenginetab.py +@@ -648,7 +648,11 @@ def load_items(self, items): + if qtutils.version_check('5.15', compiled=False): + # WORKAROUND for https://github.com/qutebrowser/qutebrowser/issues/5359 + if items: +- self._tab.load_url(items[-1].url) ++ url = items[-1].url ++ if ((url.scheme(), url.host()) == ('qute', 'back') and ++ len(items) >= 2): ++ url = items[-2].url ++ self._tab.load_url(url) + return + + if items: +diff --git a/qutebrowser/html/warning-sessions.html b/qutebrowser/html/warning-sessions.html +index f93971c6ab..dd0c4127b6 100644 +--- a/qutebrowser/html/warning-sessions.html ++++ b/qutebrowser/html/warning-sessions.html +@@ -15,6 +15,7 @@

{{ title }}

+ +
    +
  • Loading a session with this release will only load the most recently opened page for every tab. As a result, the back/forward-history of every tab will be lost as soon as the session is saved again.
  • ++
  • Due to that, the session.lazy_restore setting does not have any effect.
  • +
  • A one-time backup of the session folder has been created at {{ datadir }}{{ sep }}sessions{{ sep }}before-qt-515.
  • +
+ diff --git a/www-client/qutebrowser/qutebrowser-1.11.1.ebuild b/www-client/qutebrowser/qutebrowser-1.11.1-r1.ebuild similarity index 97% rename from www-client/qutebrowser/qutebrowser-1.11.1.ebuild rename to www-client/qutebrowser/qutebrowser-1.11.1-r1.ebuild index aa75aa620455..2cfc68ac7db0 100644 --- a/www-client/qutebrowser/qutebrowser-1.11.1.ebuild +++ b/www-client/qutebrowser/qutebrowser-1.11.1-r1.ebuild @@ -38,6 +38,8 @@ distutils_enable_tests setup.py # isn't complete and X11 is required in order to start up qutebrowser. RESTRICT="test" +PATCHES=( "${FILESDIR}"/${P}-session-restore.patch ) + python_compile_all() { a2x -f manpage doc/${PN}.1.asciidoc || die "Failed generating man page" }