From 1777c26a44daa5b87c7b88dd611008aaa59576eb Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 29 May 2021 14:55:24 +0300 Subject: DocumentWidget: Retain scroll position Use scroll position from history when the page content wasn't in the cache. --- src/ui/documentwidget.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ui/documentwidget.c') diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index a02e0bca..f37b2b6d 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -1599,6 +1599,10 @@ static iBool updateFromHistory_DocumentWidget_(iDocumentWidget *d) { else if (!isEmpty_String(d->mod.url)) { fetch_DocumentWidget_(d); } + if (recent) { + /* Retain scroll position in refetched content as well. */ + d->initNormScrollY = recent->normScrollY; + } return iFalse; } -- cgit v1.2.3