GNOME Bugzilla – Bug 781323
Keybindings for history navigation
Last modified: 2018-05-22 17:06:37 UTC
Evince has toolbar buttons for history navigation, but I could not find working keyboard bindings for this. And they don't really work well (they will not return to the previously seen page, but to the previous *jump* you did, but this seems to be reported several times already, e.g. https://bugzilla.gnome.org/show_bug.cgi?id=710681 > Go to slide 10 by preview navigation. Page back to 9, 8, 7, 6; then go to slide 1 with the preview navigation. Press "back" in history, and it will take you to slide 10 (destination of previous jump) rather than 6 (origin of current jump, and much more intuitive to "undo navigation"). I don't know if we need to store every page view or still can skip +-1 page flips, but it would certainly make sense to store both the source and the destination of a jump; when undoing the jump go the the source, when redoing go to the destination? But back to this bug report: The use of Alt+Left and Alt+Right appears to be standard for this (once the history navigation actually makes sense). E.g. Okular, Chromium, Firefox, maybe Acrobat too. The main use case is to follow a hyperlink (e.g. a literature reference in a paper, or a "\beamergotobutton" in a presentation) and then being able to return back to where one was reading and or presenting directly, with a shortcut like Alt+Left. For me, broken navigation is a major issue with using Evince.
The keybindings <alt>P and <alt>N officially go back and forward in history, respectively. However, the <alt>P shortcut seems to be for me broken in recent versions of evince. The issue you describe with navigation results from the fact that a new node in history is created only when the page number jumps by at least 2. See the "page_changed_cb()" function (https://github.com/GNOME/evince/blob/master/shell/ev-history.c) and the comments in the thread (https://bugzilla.gnome.org/show_bug.cgi?id=696891) for context.
See this bug (https://bugzilla.gnome.org/show_bug.cgi?id=785236) for an update.
If one is willing to not use mnemonics, a temporary workaround is to set "gtk-enable-mnemonics=0" in ~/.config/gtk-3.0/settings.ini.
Pending a fix for that GTK bug, it seems that there are currently two options to fix the keyboard shortcuts for history navigation: 1) Change the "<alt>P" and "<alt>N" shortcuts to something else (e.g. cursory testing suggests that <Ctrl><alt>P and <Ctrl><alt>N both work). 2) Revert the GtkPopovers in the view and action menus to GtkMenus, whose mnemonics do not interfere with keyboard shortcuts.
Created attachment 357991 [details] [review] Change keybindings for history navigation
There is a related bug that was closed recently concerning Thinkpad-specific back and forward keys ( Bug 553892 ). However the primary keybindings "<alt>P" and "<alt>N" still seem to be broken as they conflict with mnemonics. Would it be reasonable to change these?
I'd like to suggest also binding the mouse back/forward buttons to navigation.
-- 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/770.