From 1c22f864d8df9148762d03d64832af44fbf61980 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 12 Oct 2010 21:20:18 +0200 Subject: [PATCH] Call QueryExtension before any other RandR function --- xrandr.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/xrandr.c b/xrandr.c index 5858813..0adf375 100644 --- a/xrandr.c +++ b/xrandr.c @@ -2679,7 +2679,8 @@ main (int argc, char **argv) root = RootWindow (dpy, screen); - if (!XRRQueryVersion (dpy, &major, &minor)) + if (!XRRQueryExtension (dpy, &event_base, &error_base) || + !XRRQueryVersion (dpy, &major, &minor)) { fprintf (stderr, "RandR extension missing\n"); exit (1); @@ -3372,8 +3373,6 @@ main (int argc, char **argv) root, (SizeID) size, (Rotation) (rotation | reflection), rate, CurrentTime); - XRRQueryExtension(dpy, &event_base, &error_base); - if (setit && !dryrun && status == RRSetConfigFailed) { printf ("Failed to change the screen configuration!\n"); ret = 1; -- 1.7.1