[gnome-settings-daemon] input: Clarify hotplug command exit value handling



commit 0c909e65e049c2d6f8c1eb440c899255e0ffb9b2
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Sep 21 18:24:41 2012 +0200

    input: Clarify hotplug command exit value handling
    
    The code and the comments were confused as to whether 0 or 1 should
    be the magic value to mean "don't configure this device any more".
    
    We are now using an exit value of "1" to mean "don't touch this device",
    as it requires the user explicitely saying that they don't want the
    device touched anymore. An empty script shouldn't cause all the
    configuration to suddenly break...
    
    https://bugzilla.gnome.org/show_bug.cgi?id=674251

 ...e.settings-daemon.peripherals.gschema.xml.in.in |    2 +-
 plugins/common/gsd-input-helper.c                  |    2 +-
 plugins/common/input-device-example.sh             |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/data/org.gnome.settings-daemon.peripherals.gschema.xml.in.in b/data/org.gnome.settings-daemon.peripherals.gschema.xml.in.in
index c2c2f0c..f603df8 100644
--- a/data/org.gnome.settings-daemon.peripherals.gschema.xml.in.in
+++ b/data/org.gnome.settings-daemon.peripherals.gschema.xml.in.in
@@ -157,7 +157,7 @@
     <key name="hotplug-command" type="s">
       <default>''</default>
       <_summary>Device hotplug custom command</_summary>
-      <_description>Command to be run when a device is added or removed.</_description>
+      <_description>Command to be run when a device is added or removed. An exit value of 1 means that the device will not be handled further by gnome-settings-daemon.</_description>
     </key>
   </schema>
 </schemalist>
diff --git a/plugins/common/gsd-input-helper.c b/plugins/common/gsd-input-helper.c
index c15e135..3cefa70 100644
--- a/plugins/common/gsd-input-helper.c
+++ b/plugins/common/gsd-input-helper.c
@@ -493,7 +493,7 @@ run_custom_command (GdkDevice              *device,
         g_free (argv[4]);
         g_free (argv[5]);
 
-        return (exit_status == 0);
+        return (exit_status == 1);
 }
 
 GList *
diff --git a/plugins/common/input-device-example.sh b/plugins/common/input-device-example.sh
index 67a68ed..50aa949 100644
--- a/plugins/common/input-device-example.sh
+++ b/plugins/common/input-device-example.sh
@@ -65,5 +65,5 @@ case $type in
                 ;;
 esac
 
-# All further processing will be disabled if $retval == 0
+# All further processing will be disabled if $retval == 1
 exit $retval



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