Bug 290627

Summary: Okular continuously resizes document when in "Adjust to width" mode and document area set to a size where the largest size is too high thus a vertical scrollbar is applied to it leaving the width too small.
Product: [Applications] okular Reporter: Per Olav Kroka <per_olav_kroka>
Component: generalAssignee: Okular developers <okular-devel>
Status: RESOLVED INTENTIONAL    
Severity: normal    
Priority: NOR    
Version: 0.10.5   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Per Olav Kroka 2012-01-04 20:05:57 UTC
Version:           0.10.5 (using KDE 4.4.5) 
OS:                Linux

Okular continuously resizes document when in "Adjust to width" mode and document area set to a size where the largest displayed size is too high for the document area, thus a vertical scrollbar is applied to it leaving the width too small.  The document is therefore resized back to the small size, removing the need for the scroll bar.  The disappearing scrollbar makes room for a larger document and we are back to where we started. 

Document format: landscape.
Printed Size: A4

My suggestion: a larger threshold before resizing is recommended, taking any scrollbars into account.

The reproducability refers to when all conditions are met.

Workaround: the user may change the size, but it is quite annoying when it happens.

Reproducible: Always

Steps to Reproduce:
1. Open a document
2. ensure that "Adjust to width" (possibly another string in english -- mine is norwegian nynorsk "Tilpass til breidda")
3. enshure that document area does not show the complete height.
4. reduce the width until the displayed document size starts to ocillate.

Actual Results:  
The displayed document size starts to ocillate.  
- When the largest size is displayed, there is a vertical scrollbar covering the right side of the document.
- When the smallest size is displayed, the vertical scrollbar disappears and the complete height and width is shown. The document area have space enough for the vertical scrollbar, and there seem to be extra space in addition to the document height as well.

Expected Results:  
A stabile size should have been chosen.

OS: Linux (x86_64) release 2.6.32-37-generic
Compiler: cc
Comment 1 Albert Astals Cid 2012-01-04 23:23:23 UTC
A stable size is chosen, that can't be fixed since you say, "ei! there is extra space in there", but then if we grow, there won't be extra space anymore and it'll need to show the scrollbars which as you have fit to width will mean you don't want scrollbars so we'll have to shrink the document anymore which will mean there is extra space again which will mean we can grow which will mean it does not fit and needs scrollbars, ad infinitum....

So i'm going to close this bug since it is a corner case and this is the best posible solution we found.

Of course if you think i am not right please attach a screenshot showing why i am not right.

Thanks for caring about Okular :-)