GNOME Bugzilla – Bug 688636
There is no option in the command line to open more than once the same document
Last modified: 2018-05-22 14:51:36 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.
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.
(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?
(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.
So the bug is that there is no command line option to open a copy?
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.
(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.
(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.
(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.
(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.
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
(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.
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.
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.
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.
*** Bug 708273 has been marked as a duplicate of this bug. ***
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.
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
*** Bug 752601 has been marked as a duplicate of this bug. ***
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.
(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
-- 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.