summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac4
-rw-r--r--include/X11/extensions/Xrandr.h13
-rw-r--r--man/Makefile.am3
-rw-r--r--man/Xrandr.man11
-rw-r--r--src/Xrandr.c18
-rw-r--r--src/Xrandrint.h3
-rw-r--r--src/XrrScreen.c23
8 files changed, 42 insertions, 35 deletions
diff --git a/Makefile.am b/Makefile.am
index e6c6632..bef1d41 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,4 @@
#
-# $Id$
-#
# Copyright © 2003 Keith Packard, Noah Levitt
#
# Permission to use, copy, modify, distribute, and sell this software and its
diff --git a/configure.ac b/configure.ac
index f1e3d39..299eff8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,4 @@
dnl
-dnl $Id$
-dnl
dnl Copyright © 2003 Keith Packard, Noah Levitt
dnl
dnl Permission to use, copy, modify, distribute, and sell this software and its
@@ -32,7 +30,7 @@ dnl try to keep these the same. Note that the library has an extra
dnl digit in the version number to track changes which don't affect the
dnl protocol, so Xrandr version l.n.m corresponds to protocol version l.n
dnl
-AC_INIT(libXrandr, 1.2.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXrandr)
+AC_INIT(libXrandr, 1.2.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXrandr)
AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE
diff --git a/include/X11/extensions/Xrandr.h b/include/X11/extensions/Xrandr.h
index de18f3b..892fae8 100644
--- a/include/X11/extensions/Xrandr.h
+++ b/include/X11/extensions/Xrandr.h
@@ -120,10 +120,12 @@ typedef struct {
/* internal representation is private to the library */
typedef struct _XRRScreenConfiguration XRRScreenConfiguration;
-Bool XRRQueryExtension (Display *dpy, int *event_basep, int *error_basep);
+Bool XRRQueryExtension (Display *dpy,
+ int *event_base_return,
+ int *error_base_return);
Status XRRQueryVersion (Display *dpy,
- int *major_versionp,
- int *minor_versionp);
+ int *major_version_return,
+ int *minor_version_return);
XRRScreenConfiguration *XRRGetScreenInfo (Display *dpy,
Window window);
@@ -178,8 +180,6 @@ int XRRRootToScreen(Display *dpy, Window root);
*/
-XRRScreenConfiguration *XRRScreenConfig(Display *dpy, int screen);
-XRRScreenConfiguration *XRRConfig(Screen *screen);
void XRRSelectInput(Display *dpy, Window window, int mask);
/*
@@ -374,6 +374,9 @@ XRRFreeGamma (XRRCrtcGamma *gamma);
/* Version 1.3 additions */
+XRRScreenResources *
+XRRGetScreenResourcesCurrent (Display *dpy, Window window);
+
void
XRRSetCrtcTransform (Display *dpy,
RRCrtc crtc,
diff --git a/man/Makefile.am b/man/Makefile.am
index cd175c5..f9928b3 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,4 +1,3 @@
-# $Id$
#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
#
@@ -71,8 +70,6 @@ Xrandr_shadows = \
XRRConfigCurrentConfiguration \
XRRConfigCurrentRate \
XRRRootToScreen \
- XRRScreenConfig \
- XRRConfig \
XRRSelectInput
shadows.DONE:
diff --git a/man/Xrandr.man b/man/Xrandr.man
index 00fe5f1..f5b1034 100644
--- a/man/Xrandr.man
+++ b/man/Xrandr.man
@@ -35,11 +35,11 @@
.nf
.sp
Bool XRRQueryExtension \^(\^Display *\fIdpy\fP,
- int *\fIevent_basep\fP, int *\fIerror_basep\fP\^);
+ int *\fIevent_base_return\fP, int *\fIerror_base_return\fP\^);
.sp
Status XRRQueryVersion \^(\^Display *\fIdpy\fP,
- int *\fImajor_versionp\fP,
- int *\fIminor_versionp\fP\^);
+ int *\fImajor_version_return\fP,
+ int *\fIminor_version_return\fP\^);
.sp
XRRScreenConfiguration *XRRGetScreenInfo \^(\^Display *dpy,
Drawable \fIdraw\fP\^);
@@ -90,11 +90,6 @@ int XRRRootToScreen\^(\^
Display *\fIdpy\fP,
Window \fIroot\fP\^);
.sp
-XRRScreenConfiguration *XRRScreenConfig\^(\^
- Display *\fIdpy\fP, int \fIscreen\fP\^);
-.sp
-XRRScreenConfiguration *XRRConfig\^(\^Screen *\fIscreen\fP\^);
-.sp
void XRRSelectInput\^(\^Display *\fIdpy\fP, Window \fIwindow\fP, int \fImask\fP\^);
.sp
/\(**
diff --git a/src/Xrandr.c b/src/Xrandr.c
index bcc732b..2de995c 100644
--- a/src/Xrandr.c
+++ b/src/Xrandr.c
@@ -1,6 +1,4 @@
/*
- * $XFree86: xc/lib/Xrandr/Xrandr.c,v 1.13tsi Exp $
- *
* Copyright © 2000 Compaq Computer Corporation, Inc.
* Copyright © 2002 Hewlett Packard Company, Inc.
*
@@ -282,13 +280,15 @@ int XRRRootToScreen(Display *dpy, Window root)
}
-Bool XRRQueryExtension (Display *dpy, int *event_basep, int *error_basep)
+Bool XRRQueryExtension (Display *dpy,
+ int *event_base_return,
+ int *error_base_return)
{
XExtDisplayInfo *info = XRRFindDisplay (dpy);
if (XextHasExtension(info)) {
- *event_basep = info->codes->first_event;
- *error_basep = info->codes->first_error;
+ *event_base_return = info->codes->first_event;
+ *error_base_return = info->codes->first_error;
return True;
} else {
return False;
@@ -403,9 +403,11 @@ int XRRUpdateConfiguration(XEvent *event)
if (event->type == ConfigureNotify) {
rcevent = (XConfigureEvent *) event;
snum = XRRRootToScreen(dpy, rcevent->window);
- dpy->screens[snum].width = rcevent->width;
- dpy->screens[snum].height = rcevent->height;
- return 1;
+ if (snum != -1) {
+ dpy->screens[snum].width = rcevent->width;
+ dpy->screens[snum].height = rcevent->height;
+ return 1;
+ }
}
info = XRRFindDisplay(dpy);
diff --git a/src/Xrandrint.h b/src/Xrandrint.h
index 14675bd..90c4785 100644
--- a/src/Xrandrint.h
+++ b/src/Xrandrint.h
@@ -1,7 +1,4 @@
/*
- * $XFree86: xc/lib/Xrandr/Xrandrint.h,v 1.2 2001/06/07 15:33:43 keithp Exp $
- *
- *
* Copyright © 2000, Compaq Computer Corporation,
* Copyright © 2002, Hewlett Packard, Inc.
*
diff --git a/src/XrrScreen.c b/src/XrrScreen.c
index c9f5204..df49bb5 100644
--- a/src/XrrScreen.c
+++ b/src/XrrScreen.c
@@ -32,8 +32,12 @@
#include <X11/extensions/Xrender.h>
#include "Xrandrint.h"
-XRRScreenResources *
-XRRGetScreenResources (Display *dpy, Window window)
+/*
+ * this is cheating on the knowledge that the two requests are identical
+ * but for the request number.
+ */
+static XRRScreenResources *
+doGetScreenResources (Display *dpy, Window window, int poll)
{
XExtDisplayInfo *info = XRRFindDisplay(dpy);
xRRGetScreenResourcesReply rep;
@@ -75,7 +79,8 @@ XRRGetScreenResources (Display *dpy, Window window)
GetReq (RRGetScreenResources, req);
req->reqType = info->codes->major_opcode;
- req->randrReqType = X_RRGetScreenResources;
+ req->randrReqType = poll ? X_RRGetScreenResources
+ : X_RRGetScreenResourcesCurrent;
req->window = window;
if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
@@ -187,6 +192,18 @@ XRRGetScreenResources (Display *dpy, Window window)
return (XRRScreenResources *) xrsr;
}
+XRRScreenResources *
+XRRGetScreenResources(Display *dpy, Window window)
+{
+ return doGetScreenResources(dpy, window, 1);
+}
+
+XRRScreenResources *
+XRRGetScreenResourcesCurrent(Display *dpy, Window window)
+{
+ return doGetScreenResources(dpy, window, 0);
+}
+
void
XRRFreeScreenResources (XRRScreenResources *resources)
{