[PATCH xinput] Add --enable/--disable support

Chase Douglas chase.douglas at canonical.com
Mon May 14 08:39:09 PDT 2012


On 05/14/2012 12:29 AM, Peter Hutterer wrote:
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
> I got sick of typing 'xinput set-prop "foo" "Device Enabled" 0'
> 
>  src/property.c |   14 ++++++++++++++
>  src/xinput.c   |   10 ++++++++++
>  src/xinput.h   |    2 ++
>  3 files changed, 26 insertions(+)
> 
> diff --git a/src/property.c b/src/property.c
> index 3ab2cb0..a4d07f6 100644
> --- a/src/property.c
> +++ b/src/property.c
> @@ -824,3 +824,17 @@ int set_prop(Display *display, int argc, char *argv[], char *name,
>  
>      return do_set_prop(display, type, format, argc, argv, name, desc);
>  }
> +
> +int disable(Display *display, int argc, char *argv[], char *name, char *desc)
> +{
> +    char *new_argv[3] = { NULL, "Device Enabled", "0" };
> +    new_argv[0] = argv[0];

Why can't this be:

char *new_argv[3] = { argv[0], "Device Enabled", "0" };

Does it fail to compile?

Otherwise:

Reviewed-by: Chase Douglas <chase.douglas at canonical.com>


More information about the xorg-devel mailing list