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 655469 - Left/Right Arrow keys to switch pages
Left/Right Arrow keys to switch pages
Status: RESOLVED DUPLICATE of bug 562257
Product: evince
Classification: Core
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Evince Maintainers
Evince Maintainers
: 652503 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-07-28 03:59 UTC by Behnam Esfahbod
Modified: 2015-12-02 12:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed fix for left/right arrow keys to switch pages (396 bytes, patch)
2014-06-06 11:16 UTC, linebp
none Details | Review

Description Behnam Esfahbod 2011-07-28 03:59:11 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.
Comment 1 Germán Poo-Caamaño 2013-10-25 06:10:08 UTC
*** Bug 652503 has been marked as a duplicate of this bug. ***
Comment 2 Germán Poo-Caamaño 2013-10-25 07:11:54 UTC
Maybe this bug could be fixed with:
https://bugzilla.gnome.org/show_bug.cgi?id=509029
Comment 3 Amol Pol 2013-11-23 09:07:43 UTC
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.
Comment 4 linebp 2014-05-14 08:03:34 UTC
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) {
Comment 5 linebp 2014-06-06 11:16:57 UTC
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.
Comment 6 Carlos Garcia Campos 2015-12-02 12:10:50 UTC
(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) {
Comment 7 Carlos Garcia Campos 2015-12-02 12:26:51 UTC
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 ***