Bug 167233

Summary: Resizing the main window changes the currently displayed page of a pdf document
Product: [Applications] okular Reporter: Christoph Burger-Scheidlin <mail>
Component: generalAssignee: Okular developers <okular-devel>
Status: RESOLVED NOT A BUG    
Severity: normal    
Priority: NOR    
Version: 0.6.90   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description Christoph Burger-Scheidlin 2008-07-22 18:08:09 UTC
Version:           0.6.90 (using KDE 4.0.98)
Installed from:    Ubuntu Packages
OS:                Linux

When resizing the main window of a pdf file, okular changes the currently displayed page, increasing it when the window gets smaller and decreasing it when the window gets bigger.

I have used several pdfs to test this, but will explain this bug with http://stderr.org/doc/pbuilder/pbuilder-doc.pdf which contains 28 pages. My view mode is continuous with single pages. The zoom is set to "Fit Page" and the content side bar is open.

1. Open the document.
2. Maximize the okular window (or at least make it very large)
3. Scroll down to a page close to the end, say 25
4. Restore the okular window (or make it significantly smaller)

- This causes okular to now display page 28, the last page in the document

5. Maximize the okular window again (or increase the size again)

- This causes okular to now display page 16 (this is somewhat dependent on the difference between maximized size and initial size if the non-maximized window is only slightly smaller than my screen, okular jumps to page 26.

Note that this effect only occurs with high page numbers, it will not work on the first pages. Unfortunately I could not determine the exact cut-off.

My hunch is that it is related to the size of the scroll bar in the smaller window, such that okular tries to place the scroller at the same pixel offset that it was at before and thus reaches a different page. I have not looked at the code though and this is purely speculation.
Comment 1 Pino Toscano 2008-07-22 18:11:13 UTC
Reported already (bug #167232).