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 103811 - Add smooth scrolling
Add smooth scrolling
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkScrolledWindow
2.13.x
Other Linux
: Normal enhancement
: Medium API
Assigned To: gtkdev
gtkdev
scrolling
: 148366 345435 693617 (view as bug list)
Depends on:
Blocks: 50233
 
 
Reported: 2003-01-18 12:31 UTC by Soren Sandmann Pedersen
Modified: 2014-10-04 20:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Updated patch -- this one also only redraws Ranges when their layouts actually change (22.85 KB, patch)
2003-06-29 12:25 UTC, Soren Sandmann Pedersen
none Details | Review
New patch that applies to 2.4 (28.33 KB, patch)
2004-07-24 22:20 UTC, Soren Sandmann Pedersen
none Details | Review
spintest.c (608 bytes, text/x-csrc)
2004-11-20 03:57 UTC, Rafal Rzepecki
  Details
a new fixed patch (24.42 KB, patch)
2004-11-20 04:03 UTC, Rafal Rzepecki
none Details | Review
Smoothscroll for GTK+ 2.6 (from gentoo) (25.66 KB, patch)
2005-03-05 18:19 UTC, Ernst Sjöstrand
none Details | Review
Smoothscroll for 2.13.1 (23.14 KB, patch)
2008-03-25 07:32 UTC, Björn Lindqvist
none Details | Review
Smoothscroll for 2.13.1 patch #2 (21.33 KB, patch)
2008-03-25 22:55 UTC, Björn Lindqvist
none Details | Review
Third update, two dead functions removed (21.82 KB, patch)
2008-03-27 21:06 UTC, Björn Lindqvist
none Details | Review

Comment 1 Soren Sandmann Pedersen 2003-06-29 12:25:20 UTC
Created attachment 17889 [details] [review]
Updated patch -- this one also only redraws Ranges when their layouts actually change
Comment 2 renaud_chaillat 2003-09-06 20:07:01 UTC
Along with smooth scrolling, "exponential acceleration" would be great.
I think I had seen this behaviour in konqueror, where scrolling speed 
would raise progressively while keeping an arrow key pressed for instance.
Comment 3 Owen Taylor 2004-07-24 21:03:32 UTC
*** Bug 148366 has been marked as a duplicate of this bug. ***
Comment 4 Soren Sandmann Pedersen 2004-07-24 22:20:42 UTC
Created attachment 29863 [details] [review]
New patch that applies to 2.4

People occasionally mail me and ask about an new version that applies to 2.4,
so here it is.
Comment 5 Soren Sandmann Pedersen 2004-07-24 22:24:41 UTC
By the way, one improvement (which isn't included in this patch) would be to add
a gdk_graphics_flush() that would call XGetImage() to make sure the graphics
pipeline is actually finished.

(Even better of course would be to get proper support for that operation in X).
Comment 6 Owen Taylor 2004-07-24 22:44:06 UTC
XGetImage() style flushing is really not what you want since that actually
stalls the graphics pipeline until its empty as I understand how the X
server works (though the X protocol may not require that)... you really just 
want breadcrumbs... "have all requests from this client been executed"

It's not clear to me that graphics pipelines are actually deep enough 
in practice that worrying about when stuff actually gets to the screen 
matters.
Comment 7 Soren Sandmann Pedersen 2004-07-24 23:04:03 UTC
I actually implemented XGetImage() style flushing (but it's currently tangled up
with a ton of other changes), and I think it did improve the scrolling, but that
could just be placebo.

I agree it's bad that XGetImage() flushes the graphics pipeline, but in practice
that might not matter too much, since there is probably just one active
application and that application is going to wait for the result of XGetImage()
anyway before sending more requests.

But yes, breadcrumbs are clearly better.
Comment 8 Loïc Minier 2004-10-18 13:41:17 UTC
This is Debian bug <http://bugs.debian.org/184850>.
Comment 9 Rafal Rzepecki 2004-11-20 03:57:34 UTC
Created attachment 33953 [details]
spintest.c

Test program exposing a bug in the proposed patch. value-changed signal gets
emitted twice, whereas in unpatched gtk+ it's only emitted once.
Comment 10 Rafal Rzepecki 2004-11-20 04:03:19 UTC
Created attachment 33954 [details] [review]
a new fixed patch

This fixes the problem of comment #9. It is against gtk+-2.4.13.
Comment 11 Mikael Magnusson 2004-12-17 01:19:03 UTC
Does anyone know if there's a version of this patch that applies to gtk 2.6? I
know it's just out but I thought you might have been tracking 2.5.x.
Comment 12 agnlh 2004-12-18 19:13:06 UTC
Gtk 2.6 has been released. Could someone fix the patch PLEASE?
Comment 13 Owen Taylor 2004-12-18 20:14:09 UTC
This is an experimental patch, if it was a finished, accepted thing
it would be in GTK+. If you don't have the technical knowledge to port
it to GTK+-2.6 ourself, you probably shouldn't be running it...
Comment 14 agnlh 2004-12-19 00:02:55 UTC
Rather stop using Gnome.. Not having smooth scrolling is deadly for usability.
Comment 15 Ernst Sjöstrand 2005-03-05 18:19:17 UTC
Created attachment 38308 [details] [review]
Smoothscroll for GTK+ 2.6 (from gentoo)

Gentoo's got a patch for 2.6.

How come this wasn't sent upstream?

Include?
Comment 16 Owen Taylor 2005-03-05 19:24:30 UTC
The Gentoo people really need a big LART. Not only was this patch
not considered ready to go into GTK+, it changes the GTK+ public
API...
Comment 17 Ernst Sjöstrand 2005-03-05 20:18:49 UTC
<foser> ernstp: i'm not happy you added my  patch without my consent.. i made it
buildable, i still consider it halfbroken
<foser> it is open.. but i'm not pushing it for inclusion as long as i'm not
content with it, thats the difference tberman 

I thought it should be avaliable to others to try out and improve.
Comment 18 Baybal Ni 2006-02-18 06:35:08 UTC
qt has smooth scrolling
Comment 19 Chris Koresko 2006-03-22 00:52:14 UTC
Just wanted to say I've been using Gentoo with this patch for a year or more, and it's been working very well.  Have not tried it on a really slow machine, though (the slowest is a P4 @ 2.2 GHz with a GEFORCE 2 video subsystem).

Gentoo recently backed out the patch, and when I first started to use Gnome after updating it I thought I'd gone crosseyed!

Fortunately Gentoo makes it reasonably convenient to reinsert the patch (using "portage overlays").

The smoothscroll capability (even if not this specific patch) really should be in gtk, IMHO.
Comment 20 Baybal Ni 2006-06-13 12:56:03 UTC
It will be good if we will create experimental smooth scroll in head
Comment 21 Elijah Newren 2006-06-20 17:45:16 UTC
*** Bug 345435 has been marked as a duplicate of this bug. ***
Comment 22 Björn Lindqvist 2008-03-25 07:32:11 UTC
Created attachment 107978 [details] [review]
Smoothscroll for 2.13.1

I have updated Søren's patch for GTK 2.13.1. It still works great and I hope this feature can be added to GTK soon. In this patch I have used g_timeout_add_full to restrict the redraws to 50 fps instead of the original g_idle_add_full. It seems to work just as well and is much less taxing on the cpu.
Comment 23 Björn Lindqvist 2008-03-25 22:55:09 UTC
Created attachment 108030 [details] [review]
Smoothscroll for 2.13.1 patch #2

Updated patch which fixes some issues with the last one. gtk_widget_queue_draw () is called in the right place in gtk_range_adjustment_changed (). The changes to GdkWindow is undone, they seem to make no visible difference (on my machine).
Comment 24 Björn Lindqvist 2008-03-27 21:06:06 UTC
Created attachment 108137 [details] [review]
Third update, two dead functions removed
Comment 25 mailforwho 2008-08-18 13:49:09 UTC
I'd love to see this patch applied once and for all, can someone in the know explain what's blocking it?

Is there anything a user (v. limited programming experience - sorry) can do to help with this?

Thanks
Comment 26 Volodymyr Buell 2009-02-24 09:19:55 UTC
I want to ask why this patch is still not in the codebase? What problems with it? What should be improved?
Comment 27 Baybal Ni 2010-07-24 01:41:33 UTC
Same question.
Comment 28 nh2 2011-04-18 21:58:52 UTC
Yes, an update would be nice.

Does this patch still apply well on the latest GTK 2 or even GTK 3?

Technically, I see no reason why my phone has smooth scrolling while my PC still has not.
Comment 29 Ingo 2011-10-05 20:37:13 UTC
I also opened this bug downstream on launchpad.
https://bugs.launchpad.net/ayatana-design/+bug/868510
Comment 30 Baybal Ni 2011-11-21 11:56:30 UTC
>Does this patch still apply well on the latest GTK 2 or even GTK 3?

no
Comment 31 Bastien Nocera 2011-12-01 10:38:24 UTC
Should we mark this as a dupe of bug 516725, which has updated patches for GTK3 and GTK2?
Comment 32 Tomas Bzatek 2011-12-01 15:10:17 UTC
(In reply to comment #31)
> Should we mark this as a dupe of bug 516725, which has updated patches for GTK3
> and GTK2?

The bug 516725 is related yet not the exactly the same. It primarily focuses on devices that export extended scroll information from what I understand. Not sure if a classic wheel mouse is the type of such device, all would depend on Xorg drivers I guess. It however creates a new infrastructure and if the "legacy" devices are not supported from the beginning, it would be nice to build a kind of emulation, either in gtk or (preferably) in Xorg drivers.

Worth to say, I've been using the patch from this bug for a long time on my home system and it worked just great.
Comment 33 Laurent Pointecouteau 2012-03-18 23:22:10 UTC
It looks like some progress was made since the last comment of this report. According to Phoronix, Synaptics and evdev are now handling smooth scrolling*, and it also works with some apps in Ubuntu Precise according to the downstream Launchpad report. Is there something to fix in GTK+ to ensure full smooth scrolling support for all GTK apps ?

*http://www.phoronix.com/scan.php?page=news_item&px=MTA2ODE
Comment 34 Matthias Clasen 2012-03-19 12:03:04 UTC
No
Comment 35 drago01 2013-02-11 20:36:14 UTC
*** Bug 693617 has been marked as a duplicate of this bug. ***
Comment 36 Matthias Clasen 2014-10-04 20:55:07 UTC
I consider this done, with the fine adjustment mode and autoscrolling that we have now.