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 685553 - open documents at physical size
open documents at physical size
Status: RESOLVED OBSOLETE
Product: evince
Classification: Core
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Evince Maintainers
Evince Maintainers
: 778852 (view as bug list)
Depends on: 608586
Blocks:
 
 
Reported: 2012-10-05 11:25 UTC by Christian Persch
Modified: 2018-05-22 14:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
WIP (1.60 KB, patch)
2012-11-07 14:17 UTC, Guillaume Desmottes
needs-work Details | Review

Description Christian Persch 2012-10-05 11:25:57 UTC
I open lots of PDF documents that are A4. Now my screen can show an A4 document at (almost for portrait, definitely for landscape documents) physical size for a vertically maximised window; yet new documents still open in a tiny window that I have to manually resize to be able to read the document.

So I propose that for documents where evince knows the physical size (e.g. from PDF's page size attribute) and the physical screen size, evince should size the window so that the view area is the exact physical size as one document's page (or 2 if using side-by-side), if the screen is large enough; otherwise at least maximising the window in one direction. And keeping the aspect ratio, of course.
Comment 1 Travis Reitter 2012-11-01 00:33:13 UTC
Is this a duplicate of bug 617547?
Comment 2 Christian Persch 2012-11-01 00:38:19 UTC
Related, but no dup; although fixing this one would also probably be sufficient to consider the other one fixed too. Bug 617547 asks to use the screen height, I here ask to size the document so that it's on-screen at original size (A4, e.g.).
Comment 3 Germán Poo-Caamaño 2012-11-01 03:59:12 UTC
(In reply to comment #2)
> Related, but no dup; although fixing this one would also probably be sufficient
> to consider the other one fixed too. Bug 617547 asks to use the screen height,
> I here ask to size the document so that it's on-screen at original size (A4,
> e.g.).

IMVHO, fixing this one not necessarily fix the another one.  I am thinking the case evince does not have any document (either because it failed or because it was launched as an application), which can be the case once we fix #633501.
Comment 4 Germán Poo-Caamaño 2012-11-01 03:59:44 UTC
I should have written Bug 633501
Comment 5 Guillaume Desmottes 2012-11-07 14:17:02 UTC
Created attachment 228374 [details] [review]
WIP
Comment 6 Guillaume Desmottes 2012-11-07 14:18:47 UTC
Review of attachment 228374 [details] [review]:

Here is a first, naive, trial of implementing this. I'm really not familiar with Evince's code so this is probably not the right way to do this but it seems to mostly do the job.

Ideally we should increase the height a little bit as the menu bar is taking some space preventing the first page to be completely displayed. Is there a way to easily know the height of UI on top of the document?
Comment 7 José Aliste 2012-11-07 15:57:19 UTC
GUillaume, shouldn't a gtk_widget_resize on the View widget with the width and height that you calculated be enough?
Comment 8 José Aliste 2012-11-07 15:58:39 UTC
I mean, the following python code does resize my window ensuring that the button has the 500x500 size. Something like this should work in evince.

#!/usr/bin/python
from gi.repository import Gtk

class MyWindow(Gtk.Window):

    def __init__(self):
        Gtk.Window.__init__(self, title="Hello World")

        self.button = Gtk.Button(label="Click Here")
        self.button.connect("clicked", self.on_button_clicked)
        self.add(self.button)

    def on_button_clicked(self, widget):
        widget.set_size_request(500,500)

win = MyWindow()
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()
Comment 9 Germán Poo-Caamaño 2012-11-07 19:58:20 UTC
Review of attachment 228374 [details] [review]:

I think you patch addresses better the Bug 617547 than this one.

You are mostly repeating the code from setup_document_from_metadata(), you might want to reuse the function there.
See http://git.gnome.org/browse/evince/tree/shell/ev-window.c#n1306

You might want to call the function in:
http://git.gnome.org/browse/evince/tree/shell/ev-window.c#n7649
Comment 10 Germán Poo-Caamaño 2012-11-19 08:16:29 UTC
From a conversation with Christian Persch on IRC.  I think now is clearer:

<gpoo> chpe: btw, what kind of display do you have? (for the bug report about opening in A4 by default)
<chpe> it's a 23" full-HD (1920x1080) lcd
<gpoo> how does A4 fit there?
<gpoo> I also have a full-hd display
<chpe> if I hold a sheet of A4 paper on it, it almost fits (just a few mm leftover at the bottom/top)
<gpoo> oh
<gpoo> good point
<gpoo> but you can have full-hd with different display sizes
<gpoo> how can you know the physical size?
<chpe> so I'd expect if I hold a printout of the doc on the display, it's the same size as the on-screen display (as much as possible)
<gpoo> I understand what you want
<chpe> that's where the screen dimensions and dpi values come in
<gpoo> may you elaborate a bit more?
<chpe> from the dims and dpi you can calculate which window size should give true dimensions
<gpoo> I see
<gpoo> what if you had a bigger display, what would you prefer? 
<gpoo> maximized vertically or physical match?
<chpe> gdk_screen_get_height_mm() and gdk_screen_get_height() should give the necessary info
<chpe> I'd expect the physical size match by default, not maximised
Comment 11 Germán Poo-Caamaño 2013-04-05 17:37:37 UTC
In order to determine properly the physical size, evince should use DPI properly.  So, I am adding a dependency on Bug #608586.

I think that a proper DPI calculation would allow to determine the physical size correctly.  This also affects that a zoom of 100% is does not always match with ohe document size.

One way to test it is using screenruler, change the dpi with xrandr --dpi <dpi>, and compare the size with the paper size in the document properties dialog.

FWIW, I noticed this after reading the following bug report in launchpad: https://bugs.launchpad.net/evince/+bug/311614
Comment 12 Germán Poo-Caamaño 2017-04-29 12:36:45 UTC
*** Bug 778852 has been marked as a duplicate of this bug. ***
Comment 13 GNOME Infrastructure Team 2018-05-22 14:47:37 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/evince/issues/304.