After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 388985 - evince resizes itself when opening some documents
evince resizes itself when opening some documents
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
0.7.x
Other All
: Normal normal
: 0.10
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-12-23 18:07 UTC by Antoine Pitrou
Modified: 2007-09-28 01:35 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
demonstration of the problem (490.44 KB, application/ogg)
2007-09-28 01:35 UTC, Jean-François Fortin Tam
Details

Description Antoine Pitrou 2006-12-23 18:07:39 UTC
Please describe the problem:
When some PDF documents (not all, although I don't notice a specific pattern) are opened (e.g. by clicking on a Web link), evince decides to resize its main window to a disproportionate size, often spanning more than a whole screen.

What happens precisely is that first the evince window appears, retaining the size it had in the previous session, then the document is loaded and the window is resized. I don't know why evince insists on automatically resizing the window when a document is opened, especially if it makes it too big to fit on screen.

One such PDF document is the following, but I've encountered this bug with numerous others: http://rdereel.free.fr/RondeVirguleImpression.pdf

The evince version is 0.7.0.

PS: I'm using Compiz, perhaps it is related?


Steps to reproduce:
1. 
2. 
3. 


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Wouter Bolsterlee (uws) 2006-12-24 13:13:04 UTC
Evince restores the window size if you open a document for the second time. It shouldn't stretch over your monitor though. Can you come up with a more specific description, please?
Comment 2 Antoine Pitrou 2006-12-26 20:23:37 UTC
Hi,

(In reply to comment #1)
> Evince restores the window size if you open a document for the second time.

As for the aforementioned document, it was the first time I opened it that the bug was triggered.
Actually thig bug always happens when I open a document for the first time. You are right that, when I open it for the second time, it restores the former window size.

> It
> shouldn't stretch over your monitor though.

Yet it did :-)

> Can you come up with a more
> specific description, please?

What information are you looking for? If there's something I can do to trigger debug traces or anything, tell me.

Comment 3 Nickolay V. Shmyrev 2006-12-26 20:56:12 UTC
Yes, it's the problem actually, we determine size from zoom, so if you open small page first and then open document with big pages, it may exceed screen size. We need to check for maximum allowable width and height when scaling document.
Comment 4 Antoine Pitrou 2006-12-26 21:04:06 UTC
(In reply to comment #3)
> Yes, it's the problem actually, we determine size from zoom, so if you open
> small page first and then open document with big pages, it may exceed screen
> size. We need to check for maximum allowable width and height when scaling
> document.
> 

Hmmm... Wouldn't it be more sensible to try to keep the former display width and height (in pixels), rather than keeping the former zoom size (whatever unit it is expressed in)?

After all, it is quite reasonable to expect a tool to always keep the same size on screen, unless you explicitly resize it. Also, it doesn't really mean anything to try to keep a 1:1 (or whatever N:M) display size wrt. paper, since reading on screen and reading on paper are so different.

Comment 5 Antoine Pitrou 2007-01-21 13:06:52 UTC
Bug still happens very often with evince-0.7.1-2mdv2007.1.
Comment 6 Matt Walton 2007-04-09 14:25:49 UTC
This irritates me tremendously, it often happens when opening a PDF I haven't opened before, particularly things like maps of the London Underground. The window ends up about five times wider than the screen and ten times taller (although this varies), and compiz doesn't handle such huge windows very well, leading to even more problems.

Compiz's problems aren't evince's of course, but evince should not be automatically resizing to such a huge size anyway - there's no possible way in which this is useful. Some sort of check against viewport size would seem to be in order, or just default to opening a new document with a suitable zoom to make it fit into the current window size (fit width or fit page).

The latter might irritate a different group of people of course.
Comment 7 Jean-François Fortin Tam 2007-04-09 14:37:34 UTC
ok this might be an insultingly simplified view of the problem, but why not do something like this? (warning, this is just pseudo-python-code):

if document_is_new:
    get screen_height
    get screen_width
    get document_height
    height = screen_height
    width = screen_height * document_height / screen_width
if document_has_some_dimensions_set:
   foo = get height
   bar = get width
   if (foo not <= screen_height) or (bar not <= screen_width):
      reset the size and consider the document new
   else:
       height = foo
       width = bar
Comment 8 Matt Walton 2007-04-09 18:25:28 UTC
Well I'm not sure about the initial size algorithm, but that's roughly the sort of thing I'd be going for. I assume Evince already has a way to determine the starting size for a new PDF, and that should be kept as it works well a lot of the time, just it needs constraints to stop it opening these ridiculously large windows.

Also I'd add to that algorithm a case for when the document's being opened into an existing window, which causes it to keep the same window size.

I'm persuadable on that one though.
Comment 9 Jean-François Fortin Tam 2007-04-09 18:28:12 UTC
by "opened into an existing window", I assume you mean embedded in a browser with mozplugger or something like that? Just making sure :)
Comment 10 Matt Walton 2007-04-09 18:32:12 UTC
I was meaning if you'd opened one document then used File->Open to open another - but I just checked it and it opens another window, spatial-style, so ignore that comment because it clearly is irrelevant :-)
Comment 11 Nickolay V. Shmyrev 2007-04-09 20:21:38 UTC
Hey all, I've just committed work around this problem, so it probably should be fixed in evince 0.8.1 (to be released today)
Comment 12 Wouter Bolsterlee (uws) 2007-04-10 07:20:22 UTC
(In reply to comment #8)

> Also I'd add to that algorithm a case for when the document's being opened into
> an existing window, which causes it to keep the same window size.

(In reply to comment #10)
> I was meaning if you'd opened one document then used File->Open to open another
> - but I just checked it and it opens another window, spatial-style, so ignore
> that comment because it clearly is irrelevant :-)

If you start Evince (don't provide a document url on the command line) you'll end up with an empty window. If you File->Open a document afterwards, it's loaded into the current window. So it's not irrelevant, only not so common since Evince does not provide an application launcher (.desktop file) in the Gnome menu.

Comment 13 Jean-François Fortin Tam 2007-04-10 16:11:03 UTC
The 0.8.1 version came down through ubuntu feisty's updates today, and I can confirm this as fixed on my side. Joy joy happiness! Thanks :)
Comment 14 Nickolay V. Shmyrev 2007-04-10 17:57:22 UTC
Great
Comment 15 Jean-François Fortin Tam 2007-07-29 14:20:25 UTC
It works perfectly in metacity, but I think it's screwed up if you use compiz, could you check?
Comment 16 Jean-François Fortin Tam 2007-09-28 01:35:40 UTC
Created attachment 96316 [details]
demonstration of the problem

This is definitely screwed up in compiz. Adobe Reader does not have this problem. Please reopen?