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 165120 - wishlist-spacebar scrolling
wishlist-spacebar scrolling
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
0.1.x
Other Linux
: Low enhancement
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on: 165469
Blocks: 172291
 
 
Reported: 2005-01-24 20:50 UTC by Adrian Custer
Modified: 2005-04-03 00:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Allow the space bar to be used to scroll down the page (396 bytes, patch)
2005-02-24 08:35 UTC, Emil Soleyman-Zomalan
rejected Details | Review
Allow the backspace and space bar to be used to scroll up and down the page (480 bytes, patch)
2005-02-24 08:36 UTC, Emil Soleyman-Zomalan
rejected Details | Review
Revision 2: browse document using spacebar and backspace (2.86 KB, patch)
2005-02-27 17:34 UTC, Emil Soleyman-Zomalan
needs-work Details | Review
Revision 3: browse document using spacebar and backspace (3.05 KB, patch)
2005-03-18 20:43 UTC, Emil Soleyman-Zomalan
none Details | Review
Revision 4: browse document using spacebar and backspace (2.86 KB, patch)
2005-03-18 21:40 UTC, Emil Soleyman-Zomalan
none Details | Review
Final Revision: browse document using spacebar and backspace (2.93 KB, patch)
2005-03-18 22:38 UTC, Emil Soleyman-Zomalan
none Details | Review

Description Adrian Custer 2005-01-24 20:50:02 UTC
A longstanding UNIX tradition is the ability to step through a document using
only the space bar, as in:

1) open doc
2) click space bar until the end

evince should be able to scroll down a page and between pages using only the
space bar.
Comment 1 Luka Frelih 2005-01-26 01:21:42 UTC
xpdf does this pretty well, so i suppose backspace should do the same in the
other direction.

a related confusing fact: the icon for "down" is an upward pointing arrow and
vice versa. propose to change labels to previous and next.  
Comment 2 Bryan W Clark 2005-02-08 00:27:16 UTC
Longstanding UNIX traditions aren't reasons for including features in modern
systems.  ;-)  However this seems fairly harmless.  I believe this will be
blocking on bug 165469 as well. 
Comment 3 Emil Soleyman-Zomalan 2005-02-24 08:35:24 UTC
Created attachment 37880 [details] [review]
Allow the space bar to be used to scroll down the page
Comment 4 Emil Soleyman-Zomalan 2005-02-24 08:36:34 UTC
Created attachment 37881 [details] [review]
Allow the backspace and space bar to be used to scroll up and down the page
Comment 5 Marco Pesenti Gritti 2005-02-24 09:46:27 UTC
Comment on attachment 37881 [details] [review]
Allow the backspace and space bar to be used to scroll up and down the page

Code looks good. I'll delegate approval to Bryan because of the Backspace bit.
Comment 6 Emil Soleyman-Zomalan 2005-02-24 18:49:35 UTC
I attached both patches just in case Bryan wanted to include or not include the
backspace portion. Since both these keymap events exist in xpdf, I thought
evince might want to support both.
Comment 7 Bryan W Clark 2005-02-24 23:20:07 UTC
The space bar doesn't actually scroll the page in this patch.  It seems to only
jump to the next page.  I thought the intention was to give the old UNIX flavor
of scrolling down to the end of the document and then switching pages when you
run to the end of the page.
Comment 8 Marco Pesenti Gritti 2005-02-25 08:22:04 UTC
Oh! /me is not expert enough about old UNIX flavors ;)
Comment 9 Emil Soleyman-Zomalan 2005-02-27 17:33:34 UTC
This time I've come up with a revision that allows the user to step through a
document using the spacebar and backspace keys. Please take a look at it and
tell me what, if anything, needs to be changed.
Comment 10 Emil Soleyman-Zomalan 2005-02-27 17:34:51 UTC
Created attachment 38011 [details] [review]
Revision 2: browse document using spacebar and backspace
Comment 11 Bryan W Clark 2005-02-28 03:04:32 UTC
Wow, awesome work Emil!

This looks great to me, how about you marco?
Comment 12 Marco Pesenti Gritti 2005-02-28 09:21:48 UTC
Comment on attachment 38011 [details] [review]
Revision 2: browse document using spacebar and backspace

+enum {
+	GTK_SCROLL_JUMP_FORWARD,
+	GTK_SCROLL_JUMP_BACKWARD
+};

I dont think we should "extend" a gtk enum like this, using their own
namespace. I'd rather use our own enum at this point. So EV_SCROLL_PAGE_FORWARD
etc...


+		GtkAdjustment *adjustment;
+		GtkWidget *widget = GTK_WIDGET (view);

Please factor out this part of the code to a separate static function
(ev_view_scroll_jump?)

+		GtkAdjustment *adjustment;
+		GtkWidget *widget = GTK_WIDGET (view);
+
+		double value;
+		double increment;

Do not separate var declarations with new lines.

+					;	

Please remove this here and below.

&& ev_view_get_page (view) == ev_document_get_n_pages (view->document)

Please assign this to a last_page boolean
Comment 13 Marco Pesenti Gritti 2005-02-28 09:23:37 UTC
Bryan is an increment of 0.5 * current height of the view widget the increment
we want?
Comment 14 Bryan W Clark 2005-02-28 16:56:06 UTC
Hmm, seems to work ok for me.  But I'm sure it's one of those things we won't
know what the best value is without some good testing.
Comment 15 Emil Soleyman-Zomalan 2005-02-28 20:43:01 UTC
Marco and Bryan,

I played around with the multiplier setting and assigned it (at various times)
values of 0.3, 0.33, 0.5, 0.7, and 0.8. The lower values, 0.3 and 0.33, were too
small as the number of times I had to hit the spacebar was around 6 or 7. The
higher values, 0.7 and 0.8, were too large as it only took 2 spacebar hits to
reach the end of the page. While the 0.5 multiplier takes 3 to 4 hits of the
spacebar to reach the end.

This is my unscientific observation of this so take it with a grain of salt. :)

The third revision of the patch will follow shortly.
Comment 16 Adrian Custer 2005-02-28 20:55:57 UTC
Hey all,

I don't understand what you are doing with this multiplier.

The way spacebar traditionally works is one tap on the bar moves you down to the
next area of text, possibly with a small, one or two line, overlap. The
scrolling distance is *not* arbitrary. The overlap and its size change from
program to program but the basic idea is that you are moving down a 'screen
page' at a time. 

For an example, try, in a terminal, 
    man man 
or 
    info info
and play with the spacebar. Man has no overlap, info has a two line overlap.

With pdf docs it seems the tradition is, at the bottom of the page, to move the
visible area only far enough to include the rest of the page so the reader has
to move her eye down and find the continuation of the text. This is a minor
annoyance compensated by having a nice layout of the page on the screen. (The
opposite approach would have large gaps of 'background' below the page.

hope that helps,
--adrian
Comment 17 Adrian Custer 2005-02-28 21:15:30 UTC
For your info,

I see that xpdf simply moves the screen down to the point immediately below the
previous bottom of the screen. This has the unfortunate consequence of possibly
cutting a single line into two unreadable halfs destroying the gain in time that
the spacebar provides.

gpdf follows xpdf.

gv has an annoying random distance it scrolls down. Makes every tap of the bar
demand of the user that they find their place.

ggv is broken on my system.

acroread uses the pgdown key not the space bar, and adds a bit of overlap, about
the size of the textwidth at 100% zoom, although this is probably system dependent.

Of these, acroread is the most readable. Goes to show that effort at making
things "just kick a**" makes for a good product. :-)

all the best,
adrian
Comment 18 Austin Clements 2005-03-06 15:04:12 UTC
I second this bug (I would switch to evince, but I can't effectively navigate
documents in it).  However, may I make the further suggestion that Shift-Space
perform the same backward-scrolling as backspace.  This is done by at least gv
and firefox.  While it's not generally a UNIX tradition like space-scrolling, it
makes sense from a usability standpoint.
Comment 19 Marco Pesenti Gritti 2005-03-06 21:42:45 UTC
What's up with this ? Bryan, Emil what do you think about Adrian comment?
Comment 20 Emil Soleyman-Zomalan 2005-03-07 01:26:17 UTC
I'm sorry but I haven't had a chance to look at the code for the past week. I've
read Adrian's comment about the overlapping of text between scrolls and he makes
quite a bit of sense. I will try to get that incorporated into the current patch.

Marco, I've been looking at ways to factor out the top portion of the code in
ev_view_scroll_view but I don't see what can. Can you give me a hint?
Comment 21 Marco Pesenti Gritti 2005-03-07 09:20:16 UTC
Maybe I've been unclear... I was thinking to something like

static void
ev_view_jump (EvView *view, EvScrollType scroll)

Basically all the code you added would go there. Make sense?
Comment 22 Bryan W Clark 2005-03-11 08:20:19 UTC
Yes, the goal is something like what acroread does.  Have a small amount of
overlap, like a single paragraph height.  I thought that's what this is doing
now since it does always leave the overlap available, however it's just taking
1/2 the height of the window so you do have to find your place again.  I guess
we want something like moving .75 of the window height to leave a small amount
of overlap.  Doing it by number of text lines visible would be the ideal, but
not necessary.  If we choose some small amount of height that we always overlap
it should work as intended.
Comment 23 Marco Pesenti Gritti 2005-03-12 10:17:03 UTC
Emil, if you have issues finishing this patch you could try to join
irc.gnome.org #evince in week days. I can help out...
Comment 24 Emil Soleyman-Zomalan 2005-03-12 15:32:03 UTC
Hi Marco,

I apologize for being tardy this past week but work related issues came up.
However, this weekend presents me with a good opportunity to implement Adrian's
and Bryan's suggestions.

I also will try to get on irc too to chat with everybody.
Comment 25 Marco Pesenti Gritti 2005-03-12 17:27:30 UTC
Emil, dont worry, I was just concerned you was still blocked by not having fully
understood my comments on the patch...
Comment 26 Emil Soleyman-Zomalan 2005-03-18 20:43:18 UTC
Created attachment 38917 [details] [review]
Revision 3: browse document using spacebar and backspace
Comment 27 Tommi Komulainen 2005-03-18 21:18:24 UTC
I hope this patch can avoid the annoying case where at (almost) the end of the
page you need to hit space twice to get to the next page: once to scroll only
one or two rows (or pixels at worst) and second hit is required to actually
switch pages even though the original position was already practically as good
as the end of the page.

At least if you use (back)space exclusively for scrolling that should be
avoidable by extending the scroll height appropriately.
Comment 28 Emil Soleyman-Zomalan 2005-03-18 21:40:52 UTC
Created attachment 38919 [details] [review]
Revision 4: browse document using spacebar and backspace
Comment 29 Emil Soleyman-Zomalan 2005-03-18 22:12:36 UTC
Tommi,

This patch does not avoid the case which you describe and it would be pretty
difficult to fix at the current time. We will definitely keep an eye on this in
the near future.
Comment 30 Emil Soleyman-Zomalan 2005-03-18 22:38:34 UTC
Created attachment 38922 [details] [review]
Final Revision: browse document using spacebar and backspace
Comment 31 Grant Farnsworth 2005-03-19 05:53:18 UTC
Suggestion: Remember that some people (me) will use evince for doing
presentations in fullscreen mode, so the space bar should go to the next page
when in that mode.  Thanks.
Comment 32 Bryan W Clark 2005-03-22 18:23:20 UTC
comment 27 : I'd like that too, however I don't want that requirement to halt
this patch going through.  Ideally we could work out a system that figures out
margins and viewable text areas to decide if you should go to the next page or
not.  Bug 169676 is a similar problem to this.

comment 31 : This is pretty much the same problem.  Assuming your presenation
takes up the fullscreen spacebar should take you to the next page.  Otherwise
you'll have to use page down until this is fixed. *shrug*

It's up to the maintainers really, but before we block this patch completely I'd
like to see it go in and then deal with separate bugs about the behavior
improvements.  Since I think all these behavior complaints are related to bug
169676 I don't see a need for us to block this fix waiting for the root of the
problem to be fixed.
Comment 33 Jonathan Blandford 2005-04-03 00:08:03 UTC
Committed. Thanks!