12

On a default Ubuntu 16.04 (xenial) installation, GTK3 applications (which include most of the default GUI applications) have smooth scrolling activated. How do I disable it?

For example, in Gedit, pressing PageUp/PageDown causes the text to scroll one pixel line at a time until it settles to its final position one page further up/down. The same behavior occurs in the file selection dialog box, in Nautilus, etc. How do I turn off smooth scrolling, i.e. how do I make the PageUp/PageDown keys show the previous/next page immediately?

  • I haven't seen the behaviour you're describing with gedit. Could you please try adding gtk-primary-button-warps-slider=false to ~/.config/gtk-3.0/settings.ini and see if the problem goes away? If you don't have such a file, the first line should be [Settings]. – DK Bose Apr 10 '17 at 13:08
  • @DKBose Makes no difference. – Gilles 'SO- stop being evil' Apr 10 '17 at 13:24
  • Of course it makes no difference. gtk-primary-button-warps-slider isn't directly related to scrolling. It is related to the behavior of scrollbars, which is unrelated to this question. – Danijel May 17 '17 at 13:55
  • Also, do you log out and back in for setting to get reread ? – Sergiy Kolodyazhnyy Aug 02 '18 at 14:14
  • @SergiyKolodyazhnyy https://superuser.com/questions/927160/how-can-i-disable-slow-scrolling-in-gnome-apps is about the scroll bar behavior, what does this have to do with my question? Besides it's for a different version: on Ubuntu 16.04, Gedit uses gtk2, not gtk3. – Gilles 'SO- stop being evil' Aug 02 '18 at 15:07
  • @SergiyKolodyazhnyy My bad, Gedit does use gtk3, it reads both ~/.gtkrc-2.0 and ~/.config/gtk-3.0/settings.ini. But the suggested settings have no effect (unsurprisingly). – Gilles 'SO- stop being evil' Aug 06 '18 at 12:04

3 Answers3

7

Edit the file ~/.config/gtk-3.0/settings.ini to contain the following lines:

[Settings]
gtk-enable-animations=0

If the file doesn't exist, create it. If the file already exists and already has a [Settings] section, add gtk-enable-animations=0 in this section.

Thanks to DK Bose for suggesting .config/gtk-3.0/settings.ini and to pm-b for suggesting the option name enable-animations (I was looking for “scroll”).

You don't need to reboot or to log out, but you do need to restart the application.

  • I believe this setting can be queried by running gtk-query-settings gtk-enable-animations. On my system, regardless of what I do or do not put in .config/gtk3.0/settings.ini (tried al the combinations), the gtk-enable-animations setting changes along whenever I change enable-animations using gsettings. Any clue on what could be the cause? – pm-b Aug 09 '18 at 09:02
  • @pm-b apt-cache search gtk-query-settings → no results. You are using Ubuntu 16.04, right? Gnome has a tendency to change configuration methods all the time, so what works one version of Ubuntu might not work in another version. – Gilles 'SO- stop being evil' Aug 09 '18 at 09:07
  • Oh wait you're right. I'm on my other computer. – pm-b Aug 09 '18 at 10:33
  • 1
    This does not disable smooth scrolling on Ubuntu 18.04. – clemisch Feb 12 '20 at 18:31
  • 1
    @clemisch Indeed :( Unfortunately this seems to change with every version of Gnome, and to get harder and harder each time. It makes me avoid most Gnome applications. – Gilles 'SO- stop being evil' Feb 12 '20 at 19:04
  • Thanks for your reply on this old issue. Do you have experience on this with GTK3 on Ubuntu 18.04? It annoys me so much, yet I haven't found any clue. I've asked on AskUbuntu myself (https://askubuntu.com/questions/1132444/how-to-deactivate-kinetic-scrolling-on-touchpad-in-gtk3-applications) but wasn't really successful... – clemisch Feb 13 '20 at 07:48
  • Configuration file adjustments are so much better than invocations of gsettings, dconf-editor, etc. as they also work when one does not use any GTK+-based desktop environment. Thank you for this! – mirabilos Jan 10 '22 at 18:57
6

I solved this by disabling animations in the gnome shell. Disabling animations will disable all animations. This setting can be changed in many different ways. For the change to take effect in gedit, don't forget to restart gedit.

Using gsettings (command line)

Open a terminal and run this command:

gsettings set org.gnome.desktop.interface enable-animations false

Using dconf-editor (GUI)

From the start screen, navigate to /org/gnome/desktop/interface/enable-animations

and set it to false.


Using gnome-tweak-tool (GUI)

Open gnome-tweaks. In the appearance tab, set the following option to false: animations

pomsky
  • 70,797
pm-b
  • 154
4

Unfortunately, Gnome apps have made this MAJOR mess on Ubuntu 18.04. The correct setting depends on the Desktop environment you use. For Gnome 3.x it seems that the way to disable smooth scroll is to run

gsettings set org.gnome.desktop.interface enable-animations false

which disables other animations as well.

If you're running MATE you have to use different key

gsettings set org.mate.interface gtk-enable-animations false
  • 1
    Thanks, this seems to fix this issue https://askubuntu.com/questions/1049588/gedit-last-line-obscured-by-status-bar – Mauro Mascia Nov 15 '21 at 08:25