GNOME Bugzilla – Bug 686714
No horizontal natural scrolling
Last modified: 2012-11-09 16:43:13 UTC
When I open "Mouse & Touchpad" settings and enable "Content sticks to fingers" it enable only vertical natural scrolling, not horizontal (It is really strange to scroll with different x_distance and y_distance ;) ). ~ → xinput list-props 14 | grep "Scrolling Distance" Synaptics Scrolling Distance (294): -77, 77 Synaptics Circular Scrolling Distance (307): 0.100000
Now I use this hack to fix scrolling: http://askubuntu.com/questions/203018/natural-scrolling-not-working-for-horizontal-scroll-how-to-fix-this I maybe useful for users, while developer fix GNOME :).
Created attachment 227249 [details] [review] mouse: natural horizontal scroll fix I have been looking to this in meantime. Attached patch fix it for me, but I'm not sure if it's right, because I don't know why XGetDeviceProperty gives me gint64, when format is set to 32.
Review of attachment 227249 [details] [review]: ::: plugins/mouse/gsd-mouse-manager.c @@ +1001,2 @@ if (rc == Success && act_type == XA_INTEGER && act_format == 32 && nitems >= 2) { + ptr = (gint64 *) data; This is almost certainly wrong, the data type is 32-bit (act_format).
I think there's 2 problems: 1) You should enable horizontal scrolling when enabling natural scrolling (not sure what to do when disabling it...) 2) You almost certainly want: if (natural_scroll) { ptr[0] = -abs(ptr[0]); - ptr[1] = -abs(ptr[1]); + ptr[1] = -abs(ptr[0]); } else { ptr[0] = abs(ptr[0]); - ptr[1] = abs(ptr[1]); + ptr[1] = abs(ptr[0]); }
(In reply to comment #4) > I think there's 2 problems: > 1) You should enable horizontal scrolling when enabling natural scrolling (not > sure what to do when disabling it...) Yes, this can be another problem, but I'm not able to test it currently... > 2) You almost certainly want: > if (natural_scroll) { > ptr[0] = -abs(ptr[0]); > - ptr[1] = -abs(ptr[1]); > + ptr[1] = -abs(ptr[0]); > } else { > ptr[0] = abs(ptr[0]); > - ptr[1] = abs(ptr[1]); > + ptr[1] = abs(ptr[0]); > } But the problem is that ptr[1] doesn't change horizontal value of "Scrolling Distance", the value is changed using ptr[2] or gint64 which is weird, because nitems == 2 and act_format == 32...
Created attachment 227799 [details] [review] mouse: natural horizontal scroll fix Finally I have found the answer in man pages: "If the returned format is 32, the property data will be stored as an array of longs (which in a 64-bit application will be 64-bit values that are padded in the upper 4 bytes)." So attached patch change value type to glong.
Review of attachment 227799 [details] [review]: Please, for gnome-3-6 and master. Could you please also review other uses?
(In reply to comment #7) > Review of attachment 227799 [details] [review]: > > Please, for gnome-3-6 and master. I have done... git fetch origin git merge origin/master git checkout gnome-3-6 git am 0001-mouse-natural-horizontal-scroll-fix.patch git checkout master git am 0001-mouse-natural-horizontal-scroll-fix.patch ...and it works correctly, so what is wrong? > > Could you please also review other uses? There aren't other uses of troubled format 32 in gsd-mouse-manager.c, or where should I review other uses?
(In reply to comment #8) > (In reply to comment #7) > > Review of attachment 227799 [details] [review] [details]: > > > > Please, for gnome-3-6 and master. > > I have done... > > git fetch origin > git merge origin/master > git checkout gnome-3-6 > git am 0001-mouse-natural-horizontal-scroll-fix.patch > git checkout master > git am 0001-mouse-natural-horizontal-scroll-fix.patch > > ...and it works correctly, so what is wrong? That you haven't committed yet? I've set the flag. Obviously, you won't see that if you just read it through the web interface, which is a problem... > > Could you please also review other uses? > > There aren't other uses of troubled format 32 in gsd-mouse-manager.c, or where > should I review other uses? In gnome-settings-daemon as a whole.
(In reply to comment #9) > (In reply to comment #8) > > (In reply to comment #7) > > > Review of attachment 227799 [details] [review] [details] [details]: > > > Could you please also review other uses? > > > > There aren't other uses of troubled format 32 in gsd-mouse-manager.c, or where > > should I review other uses? > > In gnome-settings-daemon as a whole. I haven't found any other problematic occurrences in gnome-settings-daemon.
commit e4edbc4639c9c177e60c711a1af9d318e17925c3 Author: Ondrej Holy <oholy@redhat.com> Date: Thu Oct 25 15:30:24 2012 +0200 mouse: natural horizontal scroll fix https://bugzilla.gnome.org/show_bug.cgi?id=686714