On Tue, Apr 21, 2009 at 12:17:59PM +0200, Julien Cristau wrote:
> Signed-off-by: Julien Cristau <[email protected]>
> ---
>  src/property.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/src/property.c b/src/property.c
> index c5c21c0..e019765 100644
> --- a/src/property.c
> +++ b/src/property.c
> @@ -549,12 +549,22 @@ set_prop(Display *dpy, int argc, char **argv, char *n, 
> char *desc)
>                      return EXIT_FAILURE;
>              }
>          } else if (type == float_atom) {
> +            if (format != 32) {
> +                fprintf(stderr, "unexpected format %d for property %s\n",
> +                        format, name);
> +                return EXIT_FAILURE;
> +            }
>              *(float *)(data.l + i) = strtod(argv[2 + i], &endptr);
>              if (endptr == argv[2 + i]) {
>                  fprintf(stderr, "argument %s could not be parsed\n", argv[2 
> + i]);
>                  return EXIT_FAILURE;
>              }
>          } else if (type == XA_ATOM) {
> +            if (format != 32) {
> +                fprintf(stderr, "unexpected format %d for property %s\n",
> +                        format, name);
> +                return EXIT_FAILURE;
> +            }
>              data.a[i] = parse_atom(dpy, argv[2 + i]);
>          } else {
>              fprintf(stderr, "unexpected type for property %s\n", name);
> -- 
> 1.6.2.3
 
Thanks. I'm going to squash the patch below in too unless you have any
objections.

Cheers,
  Peter


>From 6b98868efa20943262f7a364478fef3328b5de87 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <[email protected]>
Date: Tue, 21 Apr 2009 21:14:15 +1000
Subject: [PATCH] man: update man page for --set-prop.

Signed-off-by: Peter Hutterer <[email protected]>
---
 man/xinput.man |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/man/xinput.man b/man/xinput.man
index eeee7b9..104cafb 100644
--- a/man/xinput.man
+++ b/man/xinput.man
@@ -69,6 +69,12 @@ are 8, 16, or 32, depending on the property.
 Sets a float property for the device.
 .PP
 .TP 8
+.B xinput set-prop \fIdevice_name\fP \fIproperty\fP \fIvalue\fP
+Set the property to the given value(s). The format and type of the property
+are left as-is and the arguments are interpreted according to the property
+type. This argument can only be used to modify existing properties.
+.PP
+.TP 8
 .B xinput watch-props \fIdevice_name\fP
 Prints to standard out when property changes occur.
 .PP
-- 
1.6.2.2.447.g4afa7

_______________________________________________
xorg-devel mailing list
[email protected]
http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to