summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2010-10-12 21:20:18 +0200
committerJulien Cristau <jcristau@debian.org>2010-10-13 10:34:42 +0200
commitc7b90939f0ffcad17a5cc6cf1e28f7b027feeba5 (patch)
treeda87f9c4de60518bd22bab72e085ae83530c9af3
parent051f912f1c009a2c318214e6b3e86fa5f576d0ff (diff)
Call QueryExtension before any other RandR function (bug#30806)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Tested-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Julien Cristau <jcristau@debian.org>
-rw-r--r--xrandr.c5
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;