X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=driver%2Ftest-randr.c;h=74ead37fde2c6d1f01a57d8694f44598958d139d;hb=c85f503f5793839a6be4c818332aca4a96927bb2;hp=da86e04d79d78779064c1102ceb9d079496141a2;hpb=2d04c4f22466851aedb6ed0f2919d148f726b889;p=xscreensaver diff --git a/driver/test-randr.c b/driver/test-randr.c index da86e04d..74ead37f 100644 --- a/driver/test-randr.c +++ b/driver/test-randr.c @@ -1,5 +1,5 @@ /* test-randr.c --- playing with the Resize And Rotate extension. - * xscreensaver, Copyright (c) 2004, 2005 Jamie Zawinski + * xscreensaver, Copyright (c) 2004-2008 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -233,6 +233,43 @@ main (int argc, char **argv) fprintf(stderr, "%s: XRRGetScreenInfo(dpy, %d) ==> NULL\n", blurb(), i); } + + +# ifdef HAVE_RANDR_12 + if (major > 1 || (major == 1 && minor >= 2)) + { + int j; + XRRScreenResources *res = + XRRGetScreenResources (dpy, RootWindow (dpy, i)); + fprintf (stderr, "\n"); + for (j = 0; j < res->noutput; j++) + { + int k; + XRROutputInfo *rroi = + XRRGetOutputInfo (dpy, res, res->outputs[j]); + fprintf (stderr, "%s: Output %d: %s: %s (%d)\n", blurb(), j, + rroi->name, + (rroi->connection == RR_Disconnected ? "disconnected" : + rroi->connection == RR_UnknownConnection ? "unknown" : + "connected"), + (int) rroi->crtc); + for (k = 0; k < rroi->ncrtc; k++) + { + XRRCrtcInfo *crtci = XRRGetCrtcInfo (dpy, res, + rroi->crtcs[k]); + fprintf(stderr, "%s: %c CRTC %d (%d): %dx%d+%d+%d\n", + blurb(), + (rroi->crtc == rroi->crtcs[k] ? '+' : ' '), + k, (int) rroi->crtcs[k], + crtci->width, crtci->height, crtci->x, crtci->y); + XRRFreeCrtcInfo (crtci); + } + XRRFreeOutputInfo (rroi); + fprintf (stderr, "\n"); + } + XRRFreeScreenResources (res); + } +# endif /* HAVE_RANDR_12 */ } if (major > 0) @@ -248,7 +285,11 @@ main (int argc, char **argv) } XSync (dpy, False); - fprintf (stderr, "\n%s: awaiting events...\n", progname); + + fprintf (stderr, "\n%s: awaiting events...\n\n" + "\t(If you resize the screen or add/remove monitors, this should\n" + "\tnotice that and print stuff. Otherwise, hit ^C.)\n\n", + progname); while (1) { XEvent event;