diff --git a/xrandr.c b/xrandr.c index 2fb1212..4b53f22 100644 --- a/xrandr.c +++ b/xrandr.c @@ -2108,7 +2108,7 @@ main (int argc, char **argv) ulong_value = int_value; data = (unsigned char *) &ulong_value; nelements = 1; - format = 32; + format = actual_format; } else if ((type == XA_ATOM)) { @@ -2332,23 +2332,15 @@ main (int argc, char **argv) propinfo = XRRQueryOutputProperty(dpy, output->output.xid, props[j]); - if (actual_type == XA_INTEGER && actual_format == 8) { - int k; - - printf("\t%s:\n", XGetAtomName (dpy, props[j])); - for (k = 0; k < nitems; k++) { - if (k % 16 == 0) - printf ("\t\t"); - printf("%02x", (unsigned char)prop[k]); - if (k % 16 == 15) - printf("\n"); - } - } else if (actual_type == XA_INTEGER && - actual_format == 32) - { - printf("\t%s: %d (0x%08x)", - XGetAtomName (dpy, props[j]), - *(INT32 *)prop, *(INT32 *)prop); + if (actual_type == XA_INTEGER) { + if (actual_format == 8) + printf("\t%s: %d (0x%02x)", + XGetAtomName (dpy, props[j]), + *(unsigned char *)prop, *(unsigned char *)prop); + else if (actual_format == 32) + printf("\t%s: %d (0x%08x)", + XGetAtomName (dpy, props[j]), + *(INT32 *)prop, *(INT32 *)prop); if (propinfo->range && propinfo->num_values > 0) { printf(" range%s: ", @@ -2358,7 +2350,6 @@ main (int argc, char **argv) printf(" (%d,%d)", propinfo->values[k * 2], propinfo->values[k * 2 + 1]); } - printf("\n"); } else if (actual_type == XA_ATOM && actual_format == 32)