GNOME Bugzilla – Bug 388985
evince resizes itself when opening some documents
Last modified: 2007-09-28 01:35:40 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:
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?
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.
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.
(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.
Bug still happens very often with evince-0.7.1-2mdv2007.1.
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.
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
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.
by "opened into an existing window", I assume you mean embedded in a browser with mozplugger or something like that? Just making sure :)
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 :-)
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)
(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.
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 :)
Great
It works perfectly in metacity, but I think it's screwed up if you use compiz, could you check?
Created attachment 96316 [details] demonstration of the problem This is definitely screwed up in compiz. Adobe Reader does not have this problem. Please reopen?