Bug 341939 - Reloading a PDF document with page-aligned view jumps up in the document
Summary: Reloading a PDF document with page-aligned view jumps up in the document
Status: CONFIRMED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 1.5.3
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: investigated, triaged
Depends on:
Blocks:
 
Reported: 2014-12-16 09:18 UTC by Ralf Jung
Modified: 2018-11-29 20:42 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Jung 2014-12-16 09:18:52 UTC
When a PDF document is reloaded while it is viewed page-aligned (i.e., the top of the view port is a page boundary), then after reloading the document was scrolled up by around half a page.

Reproducible: Always

Steps to Reproduce:
1. Open a multi-page PDF document
2. Use the green "right arrow" at the bottom to page-align the view to the 2nd page
3. Hit F5

Actual Results:  
The page boundary between page 1 and 2 is now in the centre of the screen.

Expected Results:  
The displayed part of the document should not change when hitting F5.

This issue is particualrily visible when working on LaTeX Beamer slides, where typically one looks at one slide at a time and uses the "next/prev. page" button to navigate. Every LaTeX re-compile will jump around the document.

This used to work fine some years ago, but at some point it broke and for some reason I always hoped someone else would notice and fix this... ;-)
Comment 1 Albert Astals Cid 2014-12-19 23:04:33 UTC
Don't hope, report
Comment 2 Andrew Crouthamel 2018-11-18 02:03:50 UTC
I can confirm this on version 1.5.3. On a refresh, the page boundary is displayed in the middle of the screen.
Comment 3 Tobias Deiminger 2018-11-18 06:48:30 UTC
I saw this while working on bug 400890. It has the same root cause, and should be fixed with https://phabricator.kde.org/D16941.
Comment 4 Tobias Deiminger 2018-11-29 20:42:13 UTC
Git commit a29e4eaff5889eee632ce93c2e6a313cd9c011a1 by Tobias Deiminger.
Committed on 29/11/2018 at 20:41.
Pushed by tobiasdeiminger into branch 'Applications/18.12'.

Fix inconsistent viewport positioning in PageView

Summary:
This diff unifies the calculation of the viewport position from a given DocumentViewport. PageView::notifyViewportChanged and PageView::slotRelayoutPages used to handle it differntly, which resulted in viewport jumps for no reason.

It happened in various situations, e.g. when jumping to a page using the footer page navigation, or when reloading the document after presentation mode left, or when resizing the main window after presentation mode left.

The diff selects the notifyViewportChanged way (align viewport top border with page top margin) as golden behavior in case of rePos.enabled == false.
Related: bug 357958, bug 400890

341939 and 400890 are fixed partially. These two still suffer from a minor displacement that happens when finished signal arrives from pixmap generation thread.

Test Plan:
- When using the footer page navigation to jump to different pages, new page top is always algined with viewport top.
- After changing page with footer page navigation, press F5 to reload. Page top stays aligned with viewport top.
- When exiting presentation mode, and touching the file, page top stays aligned with viewport top.
- When exiting presentation mode, and changing main window size, page top stays aligned with viewport top.

Reviewers: #okular, sander

Reviewed By: sander

Subscribers: ngraham, sander, aacid, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D16941

A  +-    --    autotests/data/simple-multipage.pdf
A  +82   -0    autotests/data/simple-multipage.tex
M  +30   -0    autotests/parttest.cpp
M  +37   -30   ui/pageview.cpp
M  +1    -0    ui/pageview.h

https://commits.kde.org/okular/a29e4eaff5889eee632ce93c2e6a313cd9c011a1