GTK3 apps don't understand natural scrolling in Xubuntu

Bug #1368402 reported by Yanpas
130
This bug affects 28 people
Affects Status Importance Assigned to Milestone
Xfce4 Settings
Confirmed
Medium
xfce4-settings (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

If I choose in options natural scrolling - all gtk3 apps (evince, nautilus, ubuntu-software-center etc.) won't understand natural scrolling. There is the bad workaround - to setup gnome-settings-daemon and run it. After it natural scrolling works in gkt3 apps, but stops working in all other apps!

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: ibus (not installed)
ProcVersionSignature: Ubuntu 3.13.0-36.63-generic 3.13.11.6
Uname: Linux 3.13.0-36-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.14.1-0ubuntu3.4
Architecture: amd64
CurrentDesktop: XFCE
Date: Fri Sep 12 00:15:27 2014
InstallationDate: Installed on 2014-08-14 (27 days ago)
InstallationMedia: Xubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140723)
SourcePackage: ibus
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Yanpas (yanpaso) wrote :
Revision history for this message
Yanpas (yanpaso) wrote :

I don't know which package is guilty

affects: ibus (Ubuntu) → xfce4-settings (Ubuntu)
Revision history for this message
Thaddaeus Tintenfisch (thad-fisch-deactivatedaccount) wrote :
Revision history for this message
Thaddaeus Tintenfisch (thad-fisch-deactivatedaccount) wrote :

I suggest that you forward this issue upstream by filing a bug report on the Xfce bug tracker. Thanks in advance.

https://bugzilla.xfce.org/

Revision history for this message
In , Yanpas (yanpaso) wrote :

If I choose in options natural scrolling - all gtk3 apps (evince, nautilus, ubuntu-software-center etc.) won't understand natural scrolling. There is the bad workaround - to setup gnome-settings-daemon and run it. After it natural scrolling works in gkt3 apps, but stops working in all other apps!

ProblemType: Bug
DistroRelease: Xubuntu 14.04
Package: ibus (not installed)
ProcVersionSignature: Ubuntu 3.13.0-36.63-generic 3.13.11.6
Uname: Linux 3.13.0-36-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.14.1-0ubuntu3.4
Architecture: amd64
CurrentDesktop: XFCE
Date: Fri Sep 12 00:15:27 2014
InstallationDate: Installed on 2014-08-14 (27 days ago)
InstallationMedia: Xubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140723)
SourcePackage: ibus
UpgradeStatus: No upgrade log present (probably fresh install)

link to LP: https://bugs.launchpad.net/ubuntu/+source/xfce4-settings/+bug/1368402

Revision history for this message
Yanpas (yanpaso) wrote :
Changed in xfce4-settings:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote : Re: GTK3 apps doesn't understand natural scrolling in Xubuntu

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xfce4-settings (Ubuntu):
status: New → Confirmed
Revision history for this message
aaron-bru (aaron-bru) wrote :

Does anyone have a workaround for this?
The archlinux thread seems to conclude that you have to set the scrolling distance to negative. My 'Kensington Kensington USB Mouse' does not have any scrolling distance listed in 'xinput list-props'

I was kind of able to get it working using xorg.conf Option "ZAxisMapping" "5 4" but it messed other stuff up, didn't work well.

Revision history for this message
Mikkel Juul Erup (mijuer) wrote :

I patched gtk3 to inverse scrolling and created a package. This works in all gtk3 apps, so now I have got natural scrolling everywhere. But the downside is that it's not possible to toggle natural scrolling. It's only possible to get back the default scrolling by reinstalling the official libgtk-3-0.

It would be fairly easy to implement a check for a gsettings flag that could toggle natural scrolling.

Revision history for this message
Yanpas (yanpaso) wrote :

Could you please upload this package?

Revision history for this message
Mikkel Juul Erup (mijuer) wrote :

@Yanpas, sure, but use at your own risk :-)

dpkg -i the .deb. Then hold it if you want to prevent apt from overwriting with at new version if it becomes available. I use aptitude.

sudo aptitude hold libgtk-3-0.

amd64 .deb attached as well as my patch.

The patch in the current form is only a workaround, not a suggested official fix, because it doesn't allow for toggling natural scrolling. It just patches gtk to ALWAYS use natural scrolling

Revision history for this message
Mikkel Juul Erup (mijuer) wrote :

Here is the patch.

Revision history for this message
Yanpas (yanpaso) wrote :

@mikkel-erup-8 Thank you very much! :)

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "natural_scrolling.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
aaron-bru (aaron-bru) wrote :

Tested and using the patch on 14.04 x64, working great, thank you.
Is a proper fix for this going to need to be in libgtk3? If so, should the package assignment be changed?

Revision history for this message
Yanpas (yanpaso) wrote :

As author of fix said earlier it's not a fix but worwaround. It doesn't leave any option for user to switch back to unnatural scroillng.

Revision history for this message
Yanpas (yanpaso) wrote :

In addition after installing these package there some troubles with dependencies. But that's because it is not proposed to repos

Revision history for this message
Mikkel Juul Erup (mijuer) wrote :

@Yanpas, are you on 14.04 and did you install as suggested? I didn't encounter dependency problems myself so far.
I'll work on a patch that'll use gsettings if enough people want it.

Revision history for this message
Yanpas (yanpaso) wrote :

@mijuer I'm on trusty-proposed, not trusty and not trusty-updates. So there is newer version in my repos. Even if I install it I get dependencies errors in synaptics and other stuff

Revision history for this message
In , Thaddaeus Tintenfisch (thad-fisch-deactivatedaccount) wrote :

*** Bug 11702 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Boennhoff (boennhoff) wrote :

Thanks Thaddaeus for pointing me to this bug, i should have put more energy in searching for bugs in here - sorry.

By studying the provided information in this bug report and the referenced links and sublinks, i found a "simple" workaround that works for me (for now):

1. Get sure natural scrolling is setup in Gnome (was already the case here).
2. Setup normal (non-natural) scrolling in XFCE
3. Run '/usr/lib/gnome-settings-daemon/gnome-settings-daemon' after each XFCE session start. It just needs to start up and can be killed right afterwards, either way it complains about another settings daemon running!

Another way could be fiddling around with xinput (i assume gnome-settings-daemon is doing exactly that in the background), but i was too lazy to adapt that to my case...

Revision history for this message
In , Olivier Fourdan (fourdan) wrote :

(In reply to boennhoff from comment #2)
> Another way could be fiddling around with xinput (i assume
> gnome-settings-daemon is doing exactly that in the background), but i was
> too lazy to adapt that to my case...

I would not assume that, reverse scrolling is done at the device level, it makes no sense to me that gtk3 apps behave any differently than the others (and actually, xfce4-settings does the same as xinput).

So it needs a bit more investigation.

Revision history for this message
In , Olivier Fourdan (fourdan) wrote :

It works fine with libinput/xf86-input-libinput

Revision history for this message
In , Main-haarp (main-haarp) wrote :

My bet is that since GTK3 applications use smooth scrolling (http://who-t.blogspot.de/2011/09/whats-new-in-xi-21-smooth-scrolling.html), they listen to different scroll events than the (correctly-inverted) GTK2-based ones.

Revision history for this message
In , ubuntu38 (ubuntu38) wrote :

Like Olivier Fourdan said, libinput/xf86-input-libinput corrects the scrolling BUT left and right clicks are now and then reversed.

Revision history for this message
In , Thaddaeus Tintenfisch (thad-fisch-deactivatedaccount) wrote :

*** Bug 11941 has been marked as a duplicate of this bug. ***

Revision history for this message
Mohamed El Sharnoby (sharno) wrote : Re: GTK3 apps doesn't understand natural scrolling in Xubuntu

Any updates on a simple workaround for this bug? because it's very frustrating.

Revision history for this message
ronso0 (ronso0) wrote :

@Mikkel Juul Erup: I use libgtk-3-0_3.10.8-0ubuntu1.6_amd64.deb instead of ...0ubuntu1.2 and would like to compile it correctly.
My resulting .deb is huuuge compared to official libgtk-3-0. Would you mind sharing your configure arguments?

Revision history for this message
Yanpas (yanpaso) wrote :

I haven't built this package, but there is build log on launchpad on the page of every package, somewhere in this log you may find build keys

Revision history for this message
In , Jason Crain (jasoh) wrote :

I came across this in a Debian bug (https://bugs.debian.org/823195) and I found a workaround similar to comment #2. This works on Debian Sid, but not on Jessie, so this might not work on a system more than a year or two old.

Use normal (non-natural) scrolling in Xfce settings and run a command like:

  xinput --set-int-prop 12 "libinput Natural Scrolling Enabled" 8 1

You might have to replace the "12" with the ID of your mouse, which you can find with "xinput list". I think this is what GNOME's mouse settings does to enable natural scrolling.

Revision history for this message
In , Diazbastian (diazbastian) wrote :

I installed fedora 24 XFCE spin recently and I can confirm this behavior...

Revision history for this message
In , Paul-destefano-xfcebugs (paul-destefano-xfcebugs) wrote :

After installing xorg-x11-drv-libinput and removing xorg-x11-drv-synaptics, scrolling is consistent between GTK3 and Xfce apps, minimal testing.

I don't know what to make of the statement "left and right clicks are now and then reversed," however. Is there a separate bug for that?

Revision history for this message
In , Olivier Fourdan (fourdan) wrote :

Left and right being reversed sounds like left handed enabled.

What gives "xinput list-props <device>" on the mouse where the buttons are reversed?

Revision history for this message
fcole90 (fcole90) wrote :

I have found a workaround that seems to solve the issue in Xenial 16.04.
Credit goes to: https://forums.linuxmint.com/viewtopic.php?f=90&t=233135&p=1236836&sid=394bf7ad96c3ba102949bac4dd404a1a

In short, run in a terminal:
$ synclient

It will output a list of key-value pairs, search the key: 'VertScrollDelta' and check its value.
If its e.g. 56, set then it to -56 with the following command:

$ synclient VertScrollDelta=-56

If you want to do the same with the horizontal scroll, search instead for the key: 'HorizScrollDelta' and invert it in the same way as you did before

Revision history for this message
In , Hong Xu (xuhdev) wrote :

Switching to libinput does not work for me. My workaround is to launch gnome-settings-daemon when xfce starts in "Application Autostart" settings.

Revision history for this message
In , Carlnikolov (carlnikolov) wrote :

Is it possible to provide a solution through Mouse settings so xfce respects programs 'natural scrolling'for both GTK and non-GTK programs?

Please!!! Thank you.

Revision history for this message
ianp5a (ianp) wrote :

I have a new Xubuntu 17.04 install on a new 64bit NUC PC and the problem of different scroll direction in different apps still persists.

synclient only works if you have synaptics installed apparently.

I have searched and tried other workarounds too without success. The mixed scrolling directions are a really bad experience. Kubuntu does not have this problem.

Revision history for this message
Eric Polin (eric-polin) wrote :

Just in case, I personally address the issue by reversing the direction at the low level:

synclient | grep ScrollDelta
Session and Startup > Application Autostart > Add
 synclient VertScrollDelta=-<formerValue> HorizScrollDelta=-<formerValue>

May cause other problems if you have advanced needs, e.g. w/ a graphics tablet, but it is a perfect solution for me.

Revision history for this message
In , Gre0 (gre0) wrote :

(In reply to Jason Crain from comment #8)
> I came across this in a Debian bug (https://bugs.debian.org/823195) and I
> found a workaround similar to comment #2. This works on Debian Sid, but not
> on Jessie, so this might not work on a system more than a year or two old.
>
> Use normal (non-natural) scrolling in Xfce settings and run a command like:
>
> xinput --set-int-prop 12 "libinput Natural Scrolling Enabled" 8 1
>
> You might have to replace the "12" with the ID of your mouse, which you can
> find with "xinput list". I think this is what GNOME's mouse settings does
> to enable natural scrolling.

I can confirm the command mentioned by Jason works fine here without a reboot or logout/-in. I just checked my Device-ID with the command "xinput list" before.

xubuntu@xubuntu:~$ xinput list
Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Logitech MX Anywhere 2 id=8 [slave pointer (2)]
⎜ ↳ Logitech Unifying Device. Wireless PID:404d id=9 [slave pointer (2)]

So in my case....

          xinput --set-int-prop 8 "libinput Natural Scrolling Enabled" 8 1

...works fine at every scroll-places (Firefox, Mousepad, Whiskermenu, Terminal, etc)

Xubuntu 17.10 - At the moment still in the live-session...just before the installation.

Revision history for this message
Gre0 (gre0) wrote :

My personal solution in 'Xubuntu 17.10' (works fine in all GTK2/3 software)

>> 1 >> Looking for the Device-ID with...

:~$ xinput list

 ⎡ Virtual core pointer id=2 [master pointer (3)]
 ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
 ⎜ ↳ Logitech MX Anywhere 2 id=8 [slave pointer (2)]
 ⎜ ↳ Logitech Unifying Device. Wireless PID:404d id=9 [slave pointer (2)]
 ⎣ Virtual core keyboard id=3 [master keyboard (2)]
     ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
     ↳ Power Button id=6 [slave keyboard (3)]
     ↳ Power Button id=7 [slave keyboard (3)]
     ↳ Logitech MX Anywhere 2 id=10 [slave keyboard (3)]
     ↳ Logitech Unifying Device. Wireless PID:404d id=11 [slave keyboard (3)]

>> 2 >> enable natural scrolling with...(change the ## to your Device-ID)

:~$ xinput --set-int-prop ## "libinput Natural Scrolling Enabled" 8 1

So in my case: xinput --set-int-prop 8 "libinput Natural Scrolling Enabled" 8 1

summary: - GTK3 apps doesn't understand natural scrolling in Xubuntu
+ GTK3 apps don't understand natural scrolling in Xubuntu
Revision history for this message
In , Xgfc (xgfc) wrote :

Running Xubuntu 18.04LTS, XFCE 4.12

I have the same issue. and the solution provided by https://bugzilla.xfce.org/show_bug.cgi?id=11193#c8 (comment 8) does not fix the problem for GTK3 and other apps. the technique updated by comment 14 does not fix this either. the fix does not reverse the direction of scroll in apps. but it does reset/reverse-reverse them for the ones in which the reverse scroll was working.

to disable the "fix" I did xinput --set-int-prop 8 "libinput Natural Scrolling Disabled" 8 1 and the system went back to the original state with reverse scroll for xfce apps working and not working for other apps

xinput device properties
Device 'SynPS/2 Synaptics TouchPad':
 Device Enabled (143): 1
 Coordinate Transformation Matrix (145): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
 Device Accel Profile (276): 1
 Device Accel Constant Deceleration (277): 2.500000
 Device Accel Adaptive Deceleration (278): 1.000000
 Device Accel Velocity Scaling (279): 12.500000
 Synaptics Edges (299): 1618, 5366, 1356, 4536
 Synaptics Finger (300): 25, 30, 0
 Synaptics Tap Time (301): 180
 Synaptics Tap Move (302): 251
 Synaptics Tap Durations (303): 180, 180, 100
 Synaptics ClickPad (304): 0
 Synaptics Middle Button Timeout (305): 75
 Synaptics Two-Finger Pressure (306): 282
 Synaptics Two-Finger Width (307): 7
 Synaptics Scrolling Distance (308): 114, 114
 Synaptics Edge Scrolling (309): 0, 0, 0
 Synaptics Two-Finger Scrolling (310): 1, 1
 Synaptics Move Speed (311): 1.000000, 1.750000, 0.035014, 0.000000
 Synaptics Off (312): 1
 Synaptics Locked Drags (313): 0
 Synaptics Locked Drags Timeout (314): 5000
 Synaptics Tap Action (315): 2, 3, 0, 0, 1, 3, 2
 Synaptics Click Action (316): 1, 1, 0
 Synaptics Circular Scrolling (317): 0
 Synaptics Circular Scrolling Distance (318): 0.100000
 Synaptics Circular Scrolling Trigger (319): 0
 Synaptics Circular Pad (320): 0
 Synaptics Palm Detection (321): 0
 Synaptics Palm Dimensions (322): 10, 200
 Synaptics Coasting Speed (323): 20.000000, 50.000000
 Synaptics Pressure Motion (324): 30, 160
 Synaptics Pressure Motion Factor (325): 1.000000, 1.000000
 Synaptics Resolution Detect (326): 1
 Synaptics Grab Event Device (327): 0
 Synaptics Gestures (328): 1
 Synaptics Capabilities (329): 1, 0, 1, 1, 1, 1, 1
 Synaptics Pad Resolution (330): 76, 44
 Synaptics Area (331): 0, 0, 0, 0
 Synaptics Noise Cancellation (332): 28, 28
 Device Product ID (269): 2, 7
 Device Node (268): "/dev/input/event6"
 libinput Natural Scrolling Enabled (280):

Apps affected: (no reverse touchpad scroll)
Okular
 Evince
 Qpdfview
 libreoffice writer
chrome (pdf view specifically)
xfce4-terminal ( this was a surprise)

Not affected:
Thunar
PCMan file manager

Revision history for this message
In , Olivier Fourdan (fourdan) wrote :

(In reply to Xander from comment #15)
> Running Xubuntu 18.04LTS, XFCE 4.12
>
> I have the same issue. and the solution provided by
> https://bugzilla.xfce.org/show_bug.cgi?id=11193#c8 (comment 8) does not fix
> the problem for GTK3 and other apps. [...]

But you're not using the libinput xorg driver there, but Synaptics (it shows all over the place), so no wonder the libinput property will have no effect...

Revision history for this message
In , Xgfc (xgfc) wrote :

(In reply to Olivier Fourdan from comment #16)
> (In reply to Xander from comment #15)
> > Running Xubuntu 18.04LTS, XFCE 4.12
> >
> > I have the same issue. and the solution provided by
> > https://bugzilla.xfce.org/show_bug.cgi?id=11193#c8 (comment 8) does not fix
> > the problem for GTK3 and other apps. [...]
>
> But you're not using the libinput xorg driver there, but Synaptics (it shows
> all over the place), so no wonder the libinput property will have no
> effect...

thank you for pointing that out, in anycase, the issue remains without a workaround for now? I had tried uninstalling synaptics drivers and using just libinput, but there was no difference to the outcome.

Revision history for this message
In , Olivier Fourdan (fourdan) wrote :

It works fine here, natural scrolling with libinput xorg driver is applied automatically and works on every single tool I try, including those you listed in comment 15.

So, first things first, please provide the output of `xinput list-props <device>` on the touchpad device with “Reverse scroll” set in the UI.

Revision history for this message
In , Xgfc (xgfc) wrote :

Sorry for the delayed response, Olivier.

Solved/Workaround found

1. I set "reverse scrolling enabled" in touchpad settings
2. I removed "xserver-xorg-input-synaptics" This is the step I had not done earlier.
3. I ran xinput --set-int-prop DEVICE_ID "libinput Natural Scrolling Enabled" 8 1
4. Restarted the system

Now all applications have natural scrolling.

Thank you.

Revision history for this message
In , dinar qurbanov (qdinar) wrote :

in debian 10, i solved this running
nano /usr/share/X11/xorg.conf.d/40-libinput.conf
man libinput

Revision history for this message
In , Theo Linkspfeifer (lastonestanding) wrote :

*** Bug 12575 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Xfce-h (xfce-h) wrote :

because the gui options for "Reverse scroll direction" didnt work...

for those looking to automate setup via .bashrc, or alias, or whatever

here's what i used based on suggestions above... I have Kensington Orbit Wireless Trackball...
This way, regardless if id changes, i'm grepping and awking that number...
I have no idea what the "8 1" options are...

xinput --set-int-prop $(xinput list | grep "MOSART Semi. Orbit" | awk '{print $9}' | tr -d 'id=') "libinput Natural Scrolling Enabled" 8 1

so seems to work great for me...

Revision history for this message
In , Lon Kaut (lonkaut) wrote :

(In reply to dinar from comment #20)
> in debian 10, i solved this running
> nano /usr/share/X11/xorg.conf.d/40-libinput.conf
> man libinput

This worked for me....doing nothing else but adding
Option "NaturalScrolling" "1"
to all the mousy devices in
/usr/share/X11/xorg.conf.d/40-libinput.conf

thanks @dinar!

Revision history for this message
In , Anaggh S (anaggh) wrote :

Xubuntu 20.04

Managed to fix it.

```
sudo apt remove xserver-xorg-input-synaptics
reboot
```

The package `xserver-xorg-input-synaptics` is not included in Ubuntu 20.04 . Not sure why it is included in Xubuntu 20.04 release.

Revision history for this message
In , Johannes Brakensiek (letterus) wrote :

This way you are going to lose the features of the Synaptics driver.

A workaround retaining the driver as well as proposal for a solution I now documented over there: https://gitlab.xfce.org/xfce/xfce4-settings/-/issues/47#note_41309

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.