Bug 289010

Summary: Minimized Navigation Panel pops up when PDF is auto-reloaded
Product: [Applications] okular Reporter: Elvis Stansvik <elvstone>
Component: generalAssignee: Okular developers <okular-devel>
Status: RESOLVED FIXED    
Severity: normal CC: elvstone
Priority: NOR    
Version: 0.13.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: The test document.
Screenshot before touching test.pdf
Screenshot after touching test.pdf

Description Elvis Stansvik 2011-12-14 23:00:03 UTC
Created attachment 66763 [details]
The test document.

Version:           0.13.2 (using KDE 4.7.3) 
OS:                Linux

The Navigation Panel pops up when a PDF is reloaded due to being changed. I believe it might have something to do with the PDF containing a TOC. See the attached test document and before/after screenshots. The document was created by XeLaTeX from TeX Live.

Perhaps the logic could be changed so that Okular will ignore PDF that requests this if it's just an auto-reload and not an initial open.

Reproducible: Always

Steps to Reproduce:
1) Open the attached test.pdf.
2) Make sure the Navigation Panel is minimized (not completely hidden through Settings!)
3) $ touch test.pdf

Actual Results:  
The Navigation Panel pops up after the PDF has been auto-reloaded.

Expected Results:  
The Navigation Panel should stay hidden.

I'm actually using 1.13.3 on KDE SC 4.7.4, but I couldn't pick those in Bugzilla.
Comment 1 Elvis Stansvik 2011-12-14 23:00:27 UTC
Created attachment 66764 [details]
Screenshot before touching test.pdf
Comment 2 Elvis Stansvik 2011-12-14 23:00:47 UTC
Created attachment 66765 [details]
Screenshot after touching test.pdf
Comment 3 Albert Astals Cid 2011-12-19 23:09:51 UTC
Hmmmm, I am not sure it is a bug, the PDF has the "OpenTOC" flag that asks for the Table Of Contents to be opened when the file is opened, as "reloading" is nothing else than "opening the file again" we show the table of contents again.

What do you say, can i close this as not a bug?
Comment 4 Elvis Stansvik 2011-12-23 13:59:08 UTC
Hi Albert,

Sorry for the late reply.

I understand now that technically "reloading" is simply a close+open, and that Okular will therefore respect the OpenTOC flag and show the TOC (which means showing a collapsed sidebar).

I have a suggestion for a compromise though. If you take a look at review 103517 [1] which I just posted. This patch will make Okular remember the collapsed state of the sidebar when a file is automatically reloaded due to a file change, while still respecting the OpenTOC when a file is opened for the first time (just as before).

Would you be OK with such a compromise? I think that when a file is reloaded due to a file change, the UI should generally stay the same.

Best regards,
Elvis

[1] https://git.reviewboard.kde.org/r/103517/
Comment 5 Albert Astals Cid 2011-12-27 23:50:31 UTC
Git commit d066fb00044c90ea5f032e53485074e4d412b733 by Albert Astals Cid, on behalf of Elvis Stansvik.
Committed on 28/12/2011 at 00:49.
Pushed by aacid into branch 'KDE/4.8'.

Remember collapse state of sidebar when file is auto-reloaded
Related: bug 289010
REVIEW: 103517

M  +8    -2    part.cpp
M  +1    -0    part.h
M  +21   -11   ui/sidebar.cpp
M  +3    -0    ui/sidebar.h

http://commits.kde.org/okular/d066fb00044c90ea5f032e53485074e4d412b733