GNOME Bugzilla – Bug 743315
RFE: create history point before jump
Last modified: 2018-05-22 16:05:57 UTC
If I jump to other places in a PDF i.e. by clicking around in the index and then pressing the back button I would expect to have the same view I had right when I clicked the back button. However I will get back to the last view I jumped to (not from). If evince would save a history point for the origin of a jump too it would be way more convenient to me. The current implementation hardly ever jumps to the point I really want to see.
1+ A jump history would be a very helpful extension!
partly related to Bug 746640: https://bugzilla.gnome.org/show_bug.cgi?id=746640
*** Bug 746640 has been marked as a duplicate of this bug. ***
*** Bug 596300 has been marked as a duplicate of this bug. ***
This bug makes reading scientific papers a horrible user experience. You cannot click on a reference to see the name of the paper in the bibliography and then go back to your previous position. Your previous position in the paper is lost and you have to go find it. Three other bugs identifying this problem have been submitted with the earliest going back as far as 2009. bug 596300 bug 710681 bug 746640 I suspect that academics make up a fair chunk of evince's user base. It would seem sensible then that such an issue should perhaps be given higher priority?
I also think this is an important issue. Evince is a default pdf viewer for many linux computers in universities around the word, and broken history navigation is a major problem. An observation: evince remembers last view page for the documents that I close, and this seems to be a history point. So if I navigate a link and press back, I am returned to the page that evince saved before closing the document. Is it difficult to create a history point before navigating a link?
(In reply to kaikaikai from comment #6) > I also think this is an important issue. Evince is a default pdf viewer for > many linux computers in universities around the word, and broken history > navigation is a major problem. > > An observation: evince remembers last view page for the documents that I > close, and this seems to be a history point. So if I navigate a link and > press back, I am returned to the page that evince saved before closing the > document. > > Is it difficult to create a history point before navigating a link? If you want to give it a try, you may want to look inside the shell directory, specifically ev-history and ev-history-action.
I am confused. There is the code static void page_changed_cb (EvDocumentModel *model, gint old_page, gint new_page, EvHistory *history) { if (ABS (new_page - old_page) > 1) ev_history_add_link_for_page (history, new_page); } in ev-history.c, which (I think) is supposed to create history points each time we move further that 1 page. It is currently technically difficult for me to test if it works. But if it worked as I think it works, then I wouldn't see the bug. Maybe some of developers will have time to look at it?
Created attachment 332363 [details] [review] make history point on every page change I am not a developer, and I don't know C, but I think now I understand better what is going on. Each time the page is changed the routine page_changed_cb (see above) is called. Typically it does nothing, because pages change by +1 or -1. By a trivial modification (see my patch) we can insert a history point each time the page is changed. Then after following a link, we can always return to where we have been previously. With my patch, it works much much better for me. This is not a complete solution to the problem, because we are returned only to the beginning of the previous page, and not to where on the page we have been. But I have no idea how to do better, at least at a low cost.
I noticed that in double page view, every time I scroll to a new pair of pages, a history point is created. So after I follow a link, I can return to the page where I have been before. And also it keeps the history of the scrolling. If you incorporate my patch, single page view will behave similarly. This may be not the ideal solution for returning after visiting links, but it is way better than the current state.
See the objection at https://bugzilla.gnome.org/show_bug.cgi?id=696891#c8 (I've CC'ed the author). However I do think the behavior in the patch is an improvement. It's consistent with the behavior of Okular as well as the dual page mode of Evince, where the history constitutes a complete viewing log and not just a record of hyperlinks visited. See also https://bugzilla.gnome.org/show_bug.cgi?id=710681
Created attachment 356489 [details] [review] Save current page in history before following the link :+1: this bug. I think the callback should be something like this: static void page_changed_cb (EvDocumentModel *model, gint old_page, gint new_page, EvHistory *history) { if (ABS (new_page - old_page) > 1) { gint current_page = ev_history_get_current_page (history); if (current_page != old_page) ev_history_add_link_for_page (history, old_page); ev_history_add_link_for_page (history, new_page); } } We save the _current_ page if it's not already the top page in the history. The attached patch seems to work.
Review of attachment 356489 [details] [review]: The `current_page != old_page` check if useless since it's already contained in ev_history_add_link_for_page(). Upon adding old_page, the title in the history entry is incorrectly set to the new_page's title. All in all, see Anuj's set of patches: https://bugzilla.gnome.org/show_bug.cgi?id=710681#c3
-- 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/558.