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 659498 - Add option to reverse mouse scrolling (Natural scrolling)
Add option to reverse mouse scrolling (Natural scrolling)
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: mouse
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks: 677206
 
 
Reported: 2011-09-19 18:06 UTC by zedtux
Modified: 2012-08-17 17:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Implement Natural scrolling (5.64 KB, patch)
2011-09-19 18:06 UTC, zedtux
rejected Details | Review
org.gnome.settings-daemon.peripherals.gschema.xml patch (772 bytes, patch)
2011-09-20 14:57 UTC, zedtux
needs-work Details | Review
add touchpad natural scroll implementation (4.93 KB, patch)
2012-08-09 15:55 UTC, Ondrej Holy
needs-work Details | Review

Description zedtux 2011-09-19 18:06:59 UTC
Created attachment 196982 [details] [review]
Implement Natural scrolling

Hi,

I've done the implementation of a checbox in the "Mouse" section that reverse scroll wheel in order to have the Natural scrolling feature.

This is my first patch, so do not hesitate to tell me all bad and good things, tips, etc..

I have tested it on my Ubuntu 11.10 using the HEAD version of the gnome-control-center repo.

Regards,
Comment 1 zedtux 2011-09-20 14:57:58 UTC
Created attachment 197069 [details] [review]
org.gnome.settings-daemon.peripherals.gschema.xml patch
Comment 2 Bastien Nocera 2011-09-20 15:08:17 UTC
IMO, this doesn't make sense for mice, just for trackpads/touchpads, which resemble touch devices in their way of working.

The gnome-settings-daemon patch doesn't actually implement the feature. As for the gnome-control-center panel patch, the panel itself will be redesigned during GNOME 3.4 (and your patch comes too late for GNOME 3.2). See https://live.gnome.org/Design/SystemSettings/Mouse

I would start by making the necessary changes to gnome-settings-daemon to support the feature. The functionality needs to be only applied to touchpads. Please make sure you use git formatted patches too.
Comment 3 Bastien Nocera 2011-09-20 15:09:37 UTC
Comment on attachment 196982 [details] [review]
Implement Natural scrolling

The implementation needs to go in gnome-settings-daemon's mouse plugin, otherwise people would need to open the mouse panel to have the setting applied.
Comment 4 Bastien Nocera 2011-09-20 15:10:04 UTC
Comment on attachment 197069 [details] [review]
org.gnome.settings-daemon.peripherals.gschema.xml patch

Please use git to create your patches.
Comment 5 zedtux 2011-09-21 17:46:37 UTC
I'm using it with my mouse. It's not ONLY touchpads.

About the gnome-settings-daemon, the request has already been sent. I've attached the patch in order to allow people to test my feature.

At work, I'm using Apple OS X. When Natural scrolling come, I started to like it directly. Now I'm a fan.

So, it's a feature mouse as I have implemented it. I know it's a long there are pros and cons. So let user decide ;-)
Comment 6 zedtux 2011-09-21 17:47:25 UTC
Ha, and I followed the guide http://live.gnome.org/GnomeLove/SubmittingPatches.
So I did a `git format-patch HEAD^`.
Comment 7 Bastien Nocera 2011-09-21 18:17:36 UTC
(In reply to comment #5)
> I'm using it with my mouse. It's not ONLY touchpads.

Ok.

> About the gnome-settings-daemon, the request has already been sent. I've
> attached the patch in order to allow people to test my feature.

No it hasn't.

(In reply to comment #6)
> Ha, and I followed the guide http://live.gnome.org/GnomeLove/SubmittingPatches.
> So I did a `git format-patch HEAD^`.

git commit -a
git format-patch -1

That was the patch has commit information (such as your real name, your e-mail address, etc.).
Comment 8 zedtux 2011-09-22 15:12:23 UTC
> > About the gnome-settings-daemon, the request has already been sent. I've
> > attached the patch in order to allow people to test my feature.
> 
> No it hasn't.

I've submitted request to ubuntu-desktop@lists.ubuntu.com.

> (In reply to comment #6)
> > Ha, and I followed the guide http://live.gnome.org/GnomeLove/SubmittingPatches.
> > So I did a `git format-patch HEAD^`.
> 
> git commit -a
> git format-patch -1
> 
> That was the patch has commit information (such as your real name, your e-mail
> address, etc.).

Ha, alright. Do you want that I upload again my patch ?
Comment 9 Bastien Nocera 2011-09-22 15:20:09 UTC
(In reply to comment #8)
> > > About the gnome-settings-daemon, the request has already been sent. I've
> > > attached the patch in order to allow people to test my feature.
> > 
> > No it hasn't.
> 
> I've submitted request to ubuntu-desktop@lists.ubuntu.com.

The request to do what? I already explained that the gnome-settings-daemon patch only adds a setting. It also needs to have code to _apply_ the setting.

The only thing the gnome-control-center code should do is change the setting in GSettings.

> > (In reply to comment #6)
> > > Ha, and I followed the guide http://live.gnome.org/GnomeLove/SubmittingPatches.
> > > So I did a `git format-patch HEAD^`.
> > 
> > git commit -a
> > git format-patch -1
> > 
> > That was the patch has commit information (such as your real name, your e-mail
> > address, etc.).
> 
> Ha, alright. Do you want that I upload again my patch ?

Sure, as soon as you've fixed the bugs I mentioned in my review.
Comment 10 zedtux 2011-09-27 17:49:12 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > > > About the gnome-settings-daemon, the request has already been sent. I've
> > > > attached the patch in order to allow people to test my feature.
> > > 
> > > No it hasn't.
> > 
> > I've submitted request to ubuntu-desktop@lists.ubuntu.com.
> 
> The request to do what? I already explained that the gnome-settings-daemon
> patch only adds a setting. It also needs to have code to _apply_ the setting.
> 
> The only thing the gnome-control-center code should do is change the setting in
> GSettings.

Alright. So tell me how to submit the patch that add my feature key please?
The thing I've sent is a patch of org.gnome.settings-daemon.peripherals.mouse that add the key.
Comment 11 zedtux 2011-09-27 17:54:15 UTC
(In reply to comment #2)
> the gnome-control-center panel patch, the panel itself will be redesigned
> during GNOME 3.4 (and your patch comes too late for GNOME 3.2). See
> https://live.gnome.org/Design/SystemSettings/Mouse

I've looked up your link. How do you feel the feature I want to implement ?
Is it in the touchpad tab that make sense I agree as you said,
or in the pointer tab that make sense in my case ?

Or do you want I implement like it is and you mouse the option where you think is the best place when your redesign is finished ?
Comment 12 Bastien Nocera 2011-10-03 15:08:10 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > (In reply to comment #8)
> > > > > About the gnome-settings-daemon, the request has already been sent. I've
> > > > > attached the patch in order to allow people to test my feature.
> > > > 
> > > > No it hasn't.
> > > 
> > > I've submitted request to ubuntu-desktop@lists.ubuntu.com.
> > 
> > The request to do what? I already explained that the gnome-settings-daemon
> > patch only adds a setting. It also needs to have code to _apply_ the setting.
> > 
> > The only thing the gnome-control-center code should do is change the setting in
> > GSettings.
> 
> Alright. So tell me how to submit the patch that add my feature key please?
> The thing I've sent is a patch of org.gnome.settings-daemon.peripherals.mouse
> that add the key.

You need code to apply that setting in gnome-settings-daemon.

To generate patches, using "git commit" to commit your changes, and "git format-patch" to generate a patch with authorship information and a changelog.

(In reply to comment #11)
> (In reply to comment #2)
> > the gnome-control-center panel patch, the panel itself will be redesigned
> > during GNOME 3.4 (and your patch comes too late for GNOME 3.2). See
> > https://live.gnome.org/Design/SystemSettings/Mouse
> 
> I've looked up your link. How do you feel the feature I want to implement ?
> Is it in the touchpad tab that make sense I agree as you said,
> or in the pointer tab that make sense in my case ?
> 
> Or do you want I implement like it is and you mouse the option where you think
> is the best place when your redesign is finished ?

Let's implement the gnome-settings-daemon code first, then we can think of the UI for it.
Comment 13 Bastien Nocera 2011-10-03 15:08:11 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > (In reply to comment #8)
> > > > > About the gnome-settings-daemon, the request has already been sent. I've
> > > > > attached the patch in order to allow people to test my feature.
> > > > 
> > > > No it hasn't.
> > > 
> > > I've submitted request to ubuntu-desktop@lists.ubuntu.com.
> > 
> > The request to do what? I already explained that the gnome-settings-daemon
> > patch only adds a setting. It also needs to have code to _apply_ the setting.
> > 
> > The only thing the gnome-control-center code should do is change the setting in
> > GSettings.
> 
> Alright. So tell me how to submit the patch that add my feature key please?
> The thing I've sent is a patch of org.gnome.settings-daemon.peripherals.mouse
> that add the key.

You need code to apply that setting in gnome-settings-daemon.

To generate patches, using "git commit" to commit your changes, and "git format-patch" to generate a patch with authorship information and a changelog.

(In reply to comment #11)
> (In reply to comment #2)
> > the gnome-control-center panel patch, the panel itself will be redesigned
> > during GNOME 3.4 (and your patch comes too late for GNOME 3.2). See
> > https://live.gnome.org/Design/SystemSettings/Mouse
> 
> I've looked up your link. How do you feel the feature I want to implement ?
> Is it in the touchpad tab that make sense I agree as you said,
> or in the pointer tab that make sense in my case ?
> 
> Or do you want I implement like it is and you mouse the option where you think
> is the best place when your redesign is finished ?

Let's implement the gnome-settings-daemon code first, then we can think of the UI for it.
Comment 14 zedtux 2011-10-13 15:00:33 UTC
Where is the git repository where I can do my modification for gnome-settings-daemon please ?
Comment 15 Bastien Nocera 2011-10-13 15:01:52 UTC
(In reply to comment #14)
> Where is the git repository where I can do my modification for
> gnome-settings-daemon please ?

Same location as the rest of GNOME, including gnome-control-center. See:
http://git.gnome.org/browse/gnome-settings-daemon
for the various ways to access the repository
Comment 16 Matthias Clasen 2012-05-01 12:03:21 UTC
See bug 674716 for what changes we need for natural scrolling with xi 2.2
Comment 17 Ondrej Holy 2012-08-09 15:55:34 UTC
Created attachment 220802 [details] [review]
add touchpad natural scroll implementation 

(In reply to comment #16)
> See bug 674716 for what changes we need for natural scrolling with xi 2.2

Hi!

There is a new natural scroll implementation with xi. It is a part of mouse panel redesign https://bugzilla.gnome.org/show_bug.cgi?id=677206 .

Please review attached patch.
Comment 18 Bastien Nocera 2012-08-17 14:29:37 UTC
Review of attachment 220802 [details] [review]:

::: plugins/mouse/gsd-mouse-manager.c
@@ +964,3 @@
+set_natural_scroll (GsdMouseManager *manager,
+                    GdkDevice       *device,
+                    gboolean        natural_scroll_enabled)

Just "natural_scroll" should be fine.

@@ +982,3 @@
+        }
+
+        g_debug ("Trying to set device natural scroll for \"%s\"", gdk_device_get_name (device));

You need to print the state you want to set it to (eg. the value of natural_scroll_enabled).

@@ +1000,3 @@
+                        ptr[1] = -abs(ptr[1]);
+                }
+                else {

Same line, it should read:
} else {
Comment 19 Bastien Nocera 2012-08-17 17:03:37 UTC
Pushed with the fixes to master.