GNOME Bugzilla – Bug 655469
Left/Right Arrow keys to switch pages
Last modified: 2015-12-02 12:26:51 UTC
Both Adobe Reader and Google Chrome use Left/Right Arrow keys to switch to prev/next page when there is no need for horizontal scroll. In Evince they work only if view is set to "Best Fit", but not when it's set to a percentage value or "Fit Page Width" (which is the most popular view AFAIK). I think it would very helpful to have a consistent behaviour for arrows keys, thus making Evince use Left/Right arrow keys for page navigation as long as there is need for horizontal scrolling.
*** Bug 652503 has been marked as a duplicate of this bug. ***
Maybe this bug could be fixed with: https://bugzilla.gnome.org/show_bug.cgi?id=509029
hi, I am very much interested in this bug, can someone help me how to proceed with this bug, i am a newbie in contributing to the open source software.
I believe the best place to fix this is in the ev_view_scroll function in file libview/ev-view.c. This check looks to be the special case that makes the scrolling work when the sizing mode is set to fit page: if (view->sizing_mode == EV_SIZING_FIT_PAGE) { I suggest either tagging this extra condition on to the existing or simply replacing the previous condition with the suggested addition: horizontal && ev_view_get_scrollbar_size (view, GTK_ORIENTATION_HORIZONTAL) != 0 Is this even correct use of the ev_view_get_scrollbar_size function? It seems counter intuitive that it would return non-zero values if not present. A diff of the proposed changes to fix the feature: 955c955,956 < if (view->sizing_mode == EV_SIZING_FIT_PAGE) { --- > if (view->sizing_mode == EV_SIZING_FIT_PAGE || > horizontal && ev_view_get_scrollbar_size (view, GTK_ORIENTATION_HORIZONTAL) != 0) { or simply: 955c955 < if (view->sizing_mode == EV_SIZING_FIT_PAGE) { --- > if (horizontal && ev_view_get_scrollbar_size (view, GTK_ORIENTATION_HORIZONTAL) != 0) {
Created attachment 278015 [details] [review] Proposed fix for left/right arrow keys to switch pages I believe the best place to fix this is in the ev_view_scroll function in file libview/ev-view.c. This check looks to be the special case that makes the scrolling work when the sizing mode is set to fit page: if (view->sizing_mode == EV_SIZING_FIT_PAGE) { I suggest either tagging this extra condition on to the existing or simply replacing the previous condition with the suggested addition: horizontal && ev_view_get_scrollbar_size (view, GTK_ORIENTATION_HORIZONTAL) != 0 Is this even correct use of the ev_view_get_scrollbar_size function? It seems counter intuitive that it would return non-zero values if not present.
(In reply to linebp from comment #4) > I believe the best place to fix this is in the ev_view_scroll function in > file libview/ev-view.c. This check looks to be the special case that makes > the scrolling work when the sizing mode is set to fit page: > if (view->sizing_mode == EV_SIZING_FIT_PAGE) { > > I suggest either tagging this extra condition on to the existing or simply > replacing the previous condition with the suggested addition: > horizontal && ev_view_get_scrollbar_size (view, GTK_ORIENTATION_HORIZONTAL) > != 0 > > Is this even correct use of the ev_view_get_scrollbar_size function? It > seems counter intuitive that it would return non-zero values if not present. No, I think ev_view_get_scrollbar_size is simply wrong and should be fixed, but for this patch, I think we should actually simply check if the requested size is bigger than the allocated size, since we don't really need th actual scrollbar size, only whether it's visible or not. Maybe we could add ev_view_is_scrollbar_visible() and se that from get_scrollbar_size to return early when scrollbar is hidden. > A diff of the proposed changes to fix the feature: > 955c955,956 > < if (view->sizing_mode == EV_SIZING_FIT_PAGE) { > --- > > if (view->sizing_mode == EV_SIZING_FIT_PAGE || > > horizontal && ev_view_get_scrollbar_size (view, GTK_ORIENTATION_HORIZONTAL) != 0) { > > or simply: > 955c955 > < if (view->sizing_mode == EV_SIZING_FIT_PAGE) { > --- > > if (horizontal && ev_view_get_scrollbar_size (view, GTK_ORIENTATION_HORIZONTAL) != 0) {
Marek's patch in bug #562257 would fix this as well, so I'm marking this a duplicate. *** This bug has been marked as a duplicate of bug 562257 ***