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 710426 - Should use smooth scrolling events to scroll smoothly when possible
Should use smooth scrolling events to scroll smoothly when possible
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: VTE Maintainers
VTE Maintainers
[fixed-0-36][needed-next][commit:7efb...
Depends on: 710619
Blocks:
 
 
Reported: 2013-10-17 21:20 UTC by Eric Piel
Modified: 2015-03-24 14:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch: implement smooth scrolling (4.77 KB, patch)
2013-10-20 13:25 UTC, Egmont Koblinger
none Details | Review
patch: implement smooth scrolling, v2 (4.76 KB, patch)
2013-10-20 13:49 UTC, Egmont Koblinger
rejected Details | Review
patch: implement smooth scrolling, v3 (7.06 KB, patch)
2013-10-21 21:37 UTC, Egmont Koblinger
committed Details | Review

Description Eric Piel 2013-10-17 21:20:37 UTC
Currently, the VTE window scrolls by 4 lines on each scroll event. When using input device such as a touchpad, it gives a very rough scrolling (especially compared to other gnome applications). VTE should make use of the 
GDK_SMOOTH_SCROLL event and gdk_event_get_scroll_deltas() to retrieve the precise scrolling information and provide a smooth scrolling. Most probably, it is preferable to still ensure that scrolling is always done by a round number of lines (or in other words, that the top of the screen corresponds to the top of a line).

How to reproduce
 * Use a computer with a touchpad (or an input tablet)
 * Open gnome-terminal
 * Ensure the buffer has more lines than the size of the window. Ex:
  for i in $(seq 100); do echo $i; done
 * scroll up/down with the touchpad
Current behaviour: the window scrolls up/down 4 by 4 lines
Expected behaviour: the window scrolls up/down smootly 1 line at a time, at the same average speed as the current behaviour.
Comment 1 Egmont Koblinger 2013-10-20 13:25:25 UTC
Created attachment 257751 [details] [review]
patch: implement smooth scrolling

Wow, nice idea! It really gives a usability boost :)

The patch I created keeps the old scrolling speed which depends on the terminal height (it's ceil(rows/10) lines per non-smooth scroll unit). This probably made sense with the old behavior, but I'm not sure if we should keep it. I'm inclined to say that the scrolling speed should be constant, not proportional to the window heigth. Any opinions?
Comment 2 Egmont Koblinger 2013-10-20 13:49:09 UTC
Created attachment 257754 [details] [review]
patch: implement smooth scrolling, v2

I realized that the delta reported by a smooth scroll can be greater than 1. Handle this case by sending multiple scroll events to the app.
Comment 3 Egmont Koblinger 2013-10-21 21:37:28 UTC
Created attachment 257799 [details] [review]
patch: implement smooth scrolling, v3

One more fix:

In application mouse mode, the cumulated delta could go up to ±1 before processed, whereas in normal mode it could only go to ±1/3 or ±1/4 or so. As a consequence, after quitting application mouse mode a downwards scrolling action could result in upwards scrolling or vice versa (the old delta of maybe ±0.8 getting processed).

The workaround that this patch introduces is to reset the delta whenever the mouse mode changes.
Comment 4 Egmont Koblinger 2013-10-21 21:39:58 UTC
Note: There are leftovers of a smooth scolling feature in vte, set/reset by DECSET 4, stored in variable smooth_scroll. The variable is set but never used. Changelog indicates that the feature was removed in 2002. It has nothing do to with the current feature, and is safe to remove.
Comment 5 Egmont Koblinger 2013-10-21 21:40:39 UTC
Review of attachment 257754 [details] [review]:

obsolete
Comment 6 Egmont Koblinger 2013-10-21 21:40:43 UTC
Review of attachment 257754 [details] [review]:

obsolete
Comment 7 Egmont Koblinger 2013-10-22 09:52:43 UTC
Please see bug 710619, you might consider that bug as a blocker for this one.
Comment 8 Christian Persch 2013-11-18 19:29:59 UTC
Not a blocker, since it works on gnome-shell according to bug 710619 comment 0.

Fixed on vte-0-36.
Comment 9 Egmont Koblinger 2015-03-23 22:06:11 UTC
Even after a year, I still love this feature and I'm so grateful for this idea :)

I'm wondering... what if we took it a step further, and didn't insist on whole amount of cells?  E.g. just like on this very webpage, with fixed fonts, you can scroll in the browser by pixels instead of character rows and it feels even smoother.

I might come up with a prototype one day... No clue at this moment how easy or hard it will be.
Comment 10 Christian Persch 2015-03-24 14:07:20 UTC
Please file a new bug for that, this one is FIXED :-)

Shouldn't be too hard to allow scrolling non-entire rows, probably just a couple places where you need to adjust (drawing, and event handling).
Comment 11 Egmont Koblinger 2015-03-24 14:31:16 UTC
Okay: bug 746690.