d42bf90
--- gnome-settings-daemon-2.26.1/plugins/mouse/gsd-mouse-manager.c.old	2009-04-29 14:32:27.000000000 +0100
d42bf90
+++ gnome-settings-daemon-2.26.1/plugins/mouse/gsd-mouse-manager.c	2009-04-29 15:44:55.000000000 +0100
d42bf90
@@ -84,6 +84,7 @@ static void     gsd_mouse_manager_class_
d42bf90
 static void     gsd_mouse_manager_init        (GsdMouseManager      *mouse_manager);
d42bf90
 static void     gsd_mouse_manager_finalize    (GObject             *object);
d42bf90
 static void     set_mouse_settings            (GsdMouseManager      *manager);
d42bf90
+static XDevice* device_is_touchpad            (XDeviceInfo deviceinfo);
d42bf90
 
d42bf90
 G_DEFINE_TYPE (GsdMouseManager, gsd_mouse_manager, G_TYPE_OBJECT)
d42bf90
 
d42bf90
@@ -282,10 +283,18 @@ set_xinput_devices_left_handed (gboolean
d42bf90
         for (i = 0; i < n_devices; i++) {
d42bf90
                 XDevice *device = NULL;
d42bf90
 
d42bf90
-                if ((device_info[i].use != IsXExtensionDevice) ||
d42bf90
+                if ((device_info[i].use != IsXExtensionPointer) ||
d42bf90
                     (!xinput_device_has_buttons (&device_info[i])))
d42bf90
                         continue;
d42bf90
 
d42bf90
+		/* If the device is a touchpad, don't swap buttons
d42bf90
+		 * around */
d42bf90
+                device = device_is_touchpad (device_info[i]);
d42bf90
+                if (device != NULL) {
d42bf90
+			XCloseDevice (GDK_DISPLAY (), device);
d42bf90
+			continue;
d42bf90
+		}
d42bf90
+
d42bf90
                 gdk_error_trap_push ();
d42bf90
 
d42bf90
                 device = XOpenDevice (GDK_DISPLAY (), device_info[i].id);
d42bf90
@@ -372,8 +381,11 @@ set_left_handed (GsdMouseManager *manage
d42bf90
         gint n_buttons, i;
d42bf90
 
d42bf90
 #ifdef HAVE_X11_EXTENSIONS_XINPUT_H
d42bf90
+	/* When XInput support is available, never set the
d42bf90
+	 * button ordering on the core pointer */
d42bf90
         if (supports_xinput_devices ()) {
d42bf90
                 set_xinput_devices_left_handed (left_handed);
d42bf90
+                return;
d42bf90
         }
d42bf90
 #endif
d42bf90