diff options
-rw-r--r-- | tools/synclient.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/tools/synclient.c b/tools/synclient.c index 1146535..3ea9c50 100644 --- a/tools/synclient.c +++ b/tools/synclient.c @@ -51,6 +51,12 @@ #define XATOM_FLOAT "FLOAT" #endif +union flong { /* Xlibs 64-bit property handling madness */ + long l; + float f; +}; + + enum ParaType { PT_INT, PT_BOOL, @@ -426,7 +432,7 @@ dp_set_variables(Display *dpy, XDevice* dev, int argc, char *argv[], int first_c unsigned char* data; unsigned long nitems, bytes_after; - float *f; + union flong *f; long *n; char *b; @@ -479,8 +485,8 @@ dp_set_variables(Display *dpy, XDevice* dev, int argc, char *argv[], int first_c par->name, format); break; } - f = (float*)data; - f[par->prop_offset] = val; + f = (union flong*)data; + f[par->prop_offset].f = val; break; } @@ -501,7 +507,7 @@ dp_show_settings(Display *dpy, XDevice *dev) unsigned char* data; int len; - float *f; + union flong *f; long *i; char *b; @@ -555,8 +561,8 @@ dp_show_settings(Display *dpy, XDevice *dev) break; } - f = (float*)data; - printf(" %-23s = %g\n", par->name, f[par->prop_offset]); + f = (union flong*)data; + printf(" %-23s = %g\n", par->name, f[par->prop_offset].f); break; } |