[gpointing-device-settings] disable even if the other device is touchpad.



commit 8e57c88a8be1ff15bf3a3e26d7e2861f637d80ad
Author: Hiroyuki Ikezoe <poincare ikezoe net>
Date:   Fri Jan 15 20:42:24 2010 +0900

    disable even if the other device is touchpad.

 .../gsd-touchpad-manager.c                         |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c b/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c
index eef8665..131f141 100644
--- a/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c
+++ b/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c
@@ -189,26 +189,23 @@ set_disable_while_other_device_exists (GsdPointingDeviceManager *manager,
     GList *node, *pointer_infos;;
     gboolean exists_other_device = FALSE;
     gint use_type;
+    const gchar *device_name;
 
     gsd_pointing_device_manager_get_gconf_boolean(manager,
                                                   gconf,
                                                   GPDS_TOUCHPAD_DISABLE_WHILE_OTHER_DEVICE_EXISTS_KEY,
                                                   &disable);
 
+    device_name = gpds_xinput_get_device_name(xinput);
     pointer_infos = gpds_xinput_utils_collect_pointer_infos();
     for (node = pointer_infos; node; node = g_list_next(node)) {
         GpdsXInputPointerInfo *info = node->data;
-
-        if (!g_ascii_strcasecmp(gpds_xinput_pointer_info_get_type_name(info),
-                                XI_TOUCHPAD)) {
-            continue;
-        }
-        if (!strcmp(gpds_xinput_pointer_info_get_name(info),
-                    "Macintosh mouse button emulation")) {
-            continue;
+        const gchar *name = gpds_xinput_pointer_info_get_name(info);
+        if (g_ascii_strcasecmp(device_name, name) &&
+            strcmp(name, "Macintosh mouse button emulation")) {
+            exists_other_device = TRUE;
+            break;
         }
-        exists_other_device = TRUE;
-        break;
     }
     g_list_foreach(pointer_infos, (GFunc)gpds_xinput_pointer_info_free, NULL);
     g_list_free(pointer_infos);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]