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 688636 - There is no option in the command line to open more than once the same document
There is no option in the command line to open more than once the same document
Status: RESOLVED OBSOLETE
Product: evince
Classification: Core
Component: general
3.6.x
Other Linux
: Normal enhancement
: ---
Assigned To: Evince Maintainers
Evince Maintainers
: 708273 752601 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-11-19 13:26 UTC by Michal 'hramrach' Suchanek
Modified: 2018-05-22 14:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch: add option to skip dbus dances on opening a file (6.75 KB, patch)
2012-11-21 14:02 UTC, Michal 'hramrach' Suchanek
none Details | Review
patch: add option to always open a new window when opening a file is requested (12.96 KB, patch)
2012-11-22 10:31 UTC, Michal 'hramrach' Suchanek
none Details | Review

Description Michal 'hramrach' Suchanek 2012-11-19 13:26:49 UTC
It's incredibly cool that when opening the same document again evince reloads it instead of opening a new window.

However, when the document contains something like index you need the document open twice to make use of the index. Ideally the index would be present as PDF metadata as well but some documents are simplistic printouts and contain index only in visual form.
Comment 1 José Aliste 2012-11-19 13:32:14 UTC
Maybe this is an usability issue...How are you opening the same document again? 

If you want to views of the same document, just use the "open a copy" option in the file menu.
Comment 2 Germán Poo-Caamaño 2012-11-19 18:28:56 UTC
(In reply to comment #0)
> [...]
> However, when the document contains something like index you need the document
> open twice to make use of the index. Ideally the index would be present as PDF
> metadata as well but some documents are simplistic printouts and contain index
> only in visual form.

Do you have a test case that you could attach?
Comment 3 Michal 'hramrach' Suchanek 2012-11-20 13:57:30 UTC
(In reply to comment #1)
> Maybe this is an usability issue...How are you opening the same document again? 
> 
> If you want to views of the same document, just use the "open a copy" option in
> the file menu.

I open a document by running 

evince /path/to/my/document

Indeed, "open a copy" does open new view but that's odd name for that.

(In reply to comment #2)
> (In reply to comment #0)
> > [...]
> > However, when the document contains something like index you need the document
> > open twice to make use of the index. Ideally the index would be present as PDF
> > metadata as well but some documents are simplistic printouts and contain index
> > only in visual form.
> 
> Do you have a test case that you could attach?

Test case of what? Of index that is not present as PDF metadata but only as actual text or picture in the document? I don't think a test case of that is required to understand the issue.
Comment 4 José Aliste 2012-11-20 14:18:17 UTC
So the bug is that there is no command line option to open a copy?
Comment 5 Michal 'hramrach' Suchanek 2012-11-20 14:58:31 UTC
I don't really see why opening document view should not be the default when you open a document.

Even if it is not there should be some option --really-open, yes. Then I can alias it and forget about the issue.

There is in fact an option -w that basically does that but it brings up a slightly different and broken UI.
Comment 6 Germán Poo-Caamaño 2012-11-20 19:07:31 UTC
(In reply to comment #3)
> (In reply to comment #1)
> > Maybe this is an usability issue...How are you opening the same document again? 
> > 
> > If you want to views of the same document, just use the "open a copy" option in
> > the file menu.
> 
> I open a document by running 
> 
> evince /path/to/my/document
> 
> Indeed, "open a copy" does open new view but that's odd name for that.
> 
> (In reply to comment #2)
> > (In reply to comment #0)
> > > [...]
> > > However, when the document contains something like index you need the document
> > > open twice to make use of the index. Ideally the index would be present as PDF
> > > metadata as well but some documents are simplistic printouts and contain index
> > > only in visual form.
> > 
> > Do you have a test case that you could attach?
> 
> Test case of what? Of index that is not present as PDF metadata but only as
> actual text or picture in the document? I don't think a test case of that is
> required to understand the issue.

No needed.  There was no way to guess you were opening the pdf from the command line.
For future reference, having the whole context from the beginning would help a lot.
Comment 7 Germán Poo-Caamaño 2012-11-20 19:08:52 UTC
(In reply to comment #5)
> I don't really see why opening document view should not be the default when you
> open a document.
> 
> Even if it is not there should be some option --really-open, yes. Then I can
> alias it and forget about the issue.
> 
> There is in fact an option -w that basically does that but it brings up a
> slightly different and broken UI.
Comment 8 Michal 'hramrach' Suchanek 2012-11-20 20:47:51 UTC
(In reply to comment #6)
> (In reply to comment #3)
>
> > Test case of what? Of index that is not present as PDF metadata but only as
> > actual text or picture in the document? I don't think a test case of that is
> > required to understand the issue.
> 
> No needed.  There was no way to guess you were opening the pdf from the command
> line.
> For future reference, having the whole context from the beginning would help a
> lot.

Is there other way to open a PDF?

You either use the command line or use a file manager that does pretty much the same as what you do on the commandline.

You could technically start evince and use the file->open menu but that was clunky even before GTK people evolved the filechooser to near unusability.
Comment 9 Germán Poo-Caamaño 2012-11-20 21:11:41 UTC
(In reply to comment #8)
> (In reply to comment #6)
> > (In reply to comment #3)
> >
> > > Test case of what? Of index that is not present as PDF metadata but only as
> > > actual text or picture in the document? I don't think a test case of that is
> > > required to understand the issue.
> > 
> > No needed.  There was no way to guess you were opening the pdf from the command
> > line.
> > For future reference, having the whole context from the beginning would help a
> > lot.
> 
> Is there other way to open a PDF?
> 
> You either use the command line or use a file manager that does pretty much the
> same as what you do on the commandline.

The behaviour for reloading the document is done by design.  So, when you asked
I assumed you were using a file manager (not command line), where "Open a copy"
does what you were asking for (without the context you gave later).

Also, previously you had mentioned a specific type of document:

> However, when the document contains something like index you need the document
> open twice to make use of the index. Ideally the index would be present as PDF
> metadata as well but some documents are simplistic printouts and contain index
> only in visual form.

Because of the lack of more context I assumed you were asking more specific.

> You could technically start evince and use the file->open menu but that was
> clunky even before GTK people evolved the filechooser to near unusability.

You can attract more bees with honey than vinegar.
Comment 10 Germán Poo-Caamaño 2012-11-20 21:43:42 UTC
For the solution, it has to be implemented in shell/main.c, pay attention to:

http://git.gnome.org/browse/evince/tree/shell/main.c#n76 and
http://git.gnome.org/browse/evince/tree/shell/main.c#n170

and shell/ev-window.c (ev_window_open_copy_at_dest):
http://git.gnome.org/browse/evince/tree/shell/ev-window.c#n2577
Comment 11 Michal 'hramrach' Suchanek 2012-11-20 23:13:12 UTC
(In reply to comment #9)
> (In reply to comment #8)

> > 
> > Is there other way to open a PDF?
> > 
> > You either use the command line or use a file manager that does pretty much the
> > same as what you do on the commandline.
> 
> The behaviour for reloading the document is done by design.  So, when you asked
> I assumed you were using a file manager (not command line), where "Open a 
copy"
> does what you were asking for (without the context you gave later).
> 

My file manager has no "Open a copy". If you navigate to a document and press enter it runs the document handler which is evince for PDF documents. And evince does the same as it does when starting from the command line. Either the document opens or nothing happens because it is open somewhere already.
Comment 12 José Aliste 2012-11-21 00:00:37 UTC
Please, let us concentrate about the bug. It should not be that difficult to add the option if you want to try to provide a patch. 

Or if you are in a non-gnome environment you could also try to compile evince without dbus support, but I am not really sure that works anymore (but if it does not, it is a bug). Hint: when evince is compiled without dbus support, it will behave as you expect regarding opening files.
Comment 13 Michal 'hramrach' Suchanek 2012-11-21 14:02:06 UTC
Created attachment 229574 [details] [review]
patch: add option to skip dbus dances on opening a file

This is trivial patch that skips the dbus stuff and just opens the file. This means the file is always opened regardless of existing windows showing the file already. It is also not registered with the dbus service.
Comment 14 Michal 'hramrach' Suchanek 2012-11-22 10:31:07 UTC
Created attachment 229624 [details] [review]
patch: add option to always open a new window when opening a file is requested

This patch implements dbus NewView call and uses it for the -o option.
Comment 15 Germán Poo-Caamaño 2013-09-18 17:29:42 UTC
*** Bug 708273 has been marked as a duplicate of this bug. ***
Comment 16 Michal 'hramrach' Suchanek 2013-09-19 12:59:22 UTC
The naming of the option to show another view of the same document is discussed in bug 688762

Unsurprisingly, like this bug it is not even confirmed, let alone addressed.
Comment 17 Joseph Maher 2015-05-07 22:55:58 UTC
Here's the use case that makes this patch useful for me:

In my window manager I have many workspaces, arranged in a grid, and I use each row for a different project. When I check a reference with evince ref.pdf, it opens a window on the current workspace. Now later on, in a different row for a different project, I wish to look at the same reference, but now evince ref.pdf either takes me back to the other workspace, or keeps me on the same workspace and does nothing (behaviour varies with window manager). 

Yours

Joseph
Comment 18 Germán Poo-Caamaño 2015-07-20 02:38:44 UTC
*** Bug 752601 has been marked as a duplicate of this bug. ***
Comment 19 Vincent Lefevre 2016-09-12 13:54:35 UTC
Even if a new option is added, evince currently doesn't behave as documented when the user does:

  evince -f some_file.pdf

The evince(1) man page says: "Run evince in fullscreen mode." But if some_file.pdf is already open, evince is not put in fullscreen mode.
Comment 20 Germán Poo-Caamaño 2016-09-28 19:20:44 UTC
(In reply to Vincent Lefevre from comment #19)
> Even if a new option is added, evince currently doesn't behave as documented
> when the user does:
> 
>   evince -f some_file.pdf
> 
> The evince(1) man page says: "Run evince in fullscreen mode." But if
> some_file.pdf is already open, evince is not put in fullscreen mode.

This is a different bug. Filed as Bug 772139
Comment 21 GNOME Infrastructure Team 2018-05-22 14:51:36 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/316.