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 599623 - Patch to allow left-handed touchpads
Patch to allow left-handed touchpads
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: plugins
2.28.x
Other All
: Normal minor
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2009-10-26 06:21 UTC by Peter Hutterer
Modified: 2009-10-30 18:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to reverse tap-to-click order for left-handed devices (5.97 KB, patch)
2009-10-26 06:21 UTC, Peter Hutterer
needs-work Details | Review
0001-mouse-allow-left-handed-setting-for-touchpads.patch (6.02 KB, patch)
2009-10-26 23:54 UTC, Peter Hutterer
reviewed Details | Review
0001-mouse-allow-left-handed-setting-for-touchpads.patch (6.33 KB, patch)
2009-10-28 01:54 UTC, Peter Hutterer
committed Details | Review

Description Peter Hutterer 2009-10-26 06:21:54 UTC
Created attachment 146245 [details] [review]
patch to reverse tap-to-click order for left-handed devices

Touchpads cannot be switched to left-handed as this confuses the button mapping
for tap-to-click, resulting in single-finger taps being right button clicks,
etc.

In X, button mapping is handled in the server, tapping in the driver. The
driver forwards tapping just like the physical buttons and the server is
unaware that tapping is "special". The fix is simply to reverse the tapping
mapping for left handed device to cancel out the button mapping in the server.

right-handed:
- physical button 1 - posted as button 1 - mapped to logical button 1
- physical button 3 - posted as button 3 - mapped to logical button 3
- single-finger tap - posted as button 1 - mapped to logical button 1

left-handed:
- physical button 1 - posted as button 1 - mapped to logical button 3
- physical button 3 - posted as button 3 - mapped to logical button 1
- single-finger tap - posted as button 1 - mapped to logical button 3
this is the issue described here.

left-handed with patch attached:
- physical button 1 - posted as button 1 - mapped to logical button 3
- physical button 3 - posted as button 3 - mapped to logical button 1
- single-finger tap - posted as button 3 - mapped to logical button 1
Comment 1 Jens Granseuer 2009-10-26 16:47:05 UTC
Review of attachment 146245 [details] [review]:

::: plugins/mouse/gsd-mouse-manager.c
@@ +291,3 @@
                 device = device_is_touchpad (device_info[i]);
                 if (device != NULL) {
+                        GConfClient *client = gconf_client_get_default ();

Please unref the client when you're done.
Comment 2 Peter Hutterer 2009-10-26 23:54:32 UTC
Created attachment 146308 [details] [review]
0001-mouse-allow-left-handed-setting-for-touchpads.patch

done. diff to previous patch:

diff --git a/plugins/mouse/gsd-mouse-manager.c b/plugins/mouse/gsd-mouse-manager.c
index 21acca6..bc83a0f 100644
--- a/plugins/mouse/gsd-mouse-manager.c
+++ b/plugins/mouse/gsd-mouse-manager.c
@@ -296,6 +296,7 @@ set_xinput_devices_left_handed (gboolean left_handed)
                         if (tap)
                                 set_tap_to_click (tap, left_handed);
                         XCloseDevice (GDK_DISPLAY (), device);
+                        g_object_unref (client);
                 }
 
                 gdk_error_trap_push ();
Comment 3 Jens Granseuer 2009-10-27 17:25:44 UTC
Review of attachment 146308 [details] [review]:

Thanks. Feel free to commit with an update to the comment. (Do you have a g.g.o account?)

::: plugins/mouse/gsd-mouse-manager.c
@@ +290,1 @@
                  * around, otherwise a tap would be a right-click */

It seems to me this comment is no longer true after your changes. Care to update this as well?
Comment 4 Peter Hutterer 2009-10-28 01:54:39 UTC
Created attachment 146402 [details] [review]
0001-mouse-allow-left-handed-setting-for-touchpads.patch

diff to previous patch:
-                /* If the device is a touchpad, don't swap buttons
-                 * around, otherwise a tap would be a right-click */
+                /* If the device is a touchpad, swap tap buttons
+                 * around too, otherwise a tap would be a right-click */

I don't have a git account yet (haven't applied yet either), please commit for me.