[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

libxrandr: Changes to 'upstream-experimental'



 configure.ac                    |    2 -
 include/X11/extensions/Xrandr.h |   10 ++++++
 src/Xrandr.c                    |    2 -
 src/Xrandrint.h                 |    8 ++---
 src/XrrMode.c                   |    2 -
 src/XrrOutput.c                 |   62 ++++++++++++++++++++++++++++++++++++++++
 src/XrrProperty.c               |    2 -
 7 files changed, 80 insertions(+), 8 deletions(-)

New commits:
commit a0c45b798d2fa810167d64a92093840178f993b1
Author: Julien Cristau <jcristau@debian.org>
Date:   Sun Dec 21 16:32:17 2008 +0100

    Fix thinkos
    
    * XRRExtensionInfo can be static
    * XRRExtensionName is not called XrandrExtensionName

diff --git a/src/Xrandr.c b/src/Xrandr.c
index 06dbe10..c923e0f 100644
--- a/src/Xrandr.c
+++ b/src/Xrandr.c
@@ -34,7 +34,7 @@
 #include <X11/extensions/Xrender.h>
 #include "Xrandrint.h"
 
-_X_HIDDEN XExtensionInfo XRRExtensionInfo;
+static XExtensionInfo XRRExtensionInfo;
 _X_HIDDEN char XRRExtensionName[] = RANDR_NAME;
 
 static Bool     XRRWireToEvent(Display *dpy, XEvent *event, xEvent *wire);
diff --git a/src/Xrandrint.h b/src/Xrandrint.h
index abcdf3f..75e38c9 100644
--- a/src/Xrandrint.h
+++ b/src/Xrandrint.h
@@ -35,8 +35,7 @@
 #include <X11/extensions/randr.h>
 #include <X11/extensions/randrproto.h>
 
-extern XExtensionInfo XrandrExtensionInfo;
-extern char XrandrExtensionName[];
+extern char XRRExtensionName[];
 
 #define RRCheckExtension(dpy,i,val) \
   XextCheckExtension (dpy, i, XRRExtensionName, val)
@@ -88,8 +87,6 @@ typedef struct _randrVersionState {
     int		    minor_version;
 } _XRRVersionState;
 
-extern char XRRExtensionName[];
-
 Bool
 _XRRVersionHandler (Display	*dpy,
 		    xReply	*rep,

commit 8574ffb20fa10b6f2e9a5f115f23506b93c64b12
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Dec 17 11:33:37 2008 -0500

    libXrandr 1.2.99.4

diff --git a/configure.ac b/configure.ac
index 904bac8..d086cde 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,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.99.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXrandr)
+AC_INIT(libXrandr, 1.2.99.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXrandr)
 AC_CONFIG_AUX_DIR(.)
 AM_INIT_AUTOMAKE([dist-bzip2])
 AM_MAINTAINER_MODE

commit e2f075ea3927f83fb7ee8b359ef951222e8f894b
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Dec 17 11:29:05 2008 -0500

    Define _XRRHasRates internally.

diff --git a/src/Xrandrint.h b/src/Xrandrint.h
index 90c4785..abcdf3f 100644
--- a/src/Xrandrint.h
+++ b/src/Xrandrint.h
@@ -97,4 +97,7 @@ _XRRVersionHandler (Display	*dpy,
 		    int		len,
 		    XPointer    data);
 
+_X_HIDDEN Bool
+_XRRHasRates (int major, int minor);
+
 #endif /* _XRANDRINT_H_ */

commit 53bd07438d3671dca86df2bf3052f89ee8ce0891
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Dec 17 11:27:19 2008 -0500

    Be sure to return NULL when returning no properties.

diff --git a/src/XrrProperty.c b/src/XrrProperty.c
index 8377fff..d3d3246 100644
--- a/src/XrrProperty.c
+++ b/src/XrrProperty.c
@@ -41,7 +41,7 @@ XRRListOutputProperties (Display *dpy, RROutput output, int *nprop)
     int				nbytes, nbytesRead, rbytes;
     int				i;
     xRRQueryVersionReq		*vreq;
-    Atom			*props;
+    Atom			*props = NULL;
 
     RRCheckExtension (dpy, info, 0);
 

commit 7c1ccb19bd2545ccdf7099489e946e772a25649f
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Dec 17 11:25:20 2008 -0500

    Use RRCheckExtension in function returning a value.

diff --git a/src/XrrMode.c b/src/XrrMode.c
index fc624e1..fce3037 100644
--- a/src/XrrMode.c
+++ b/src/XrrMode.c
@@ -56,7 +56,7 @@ XRRCreateMode (Display *dpy, Window window, XRRModeInfo *mode_info)
     xRRCreateModeReply	    rep;
     long		    channelSize;
 
-    RRSimpleCheckExtension (dpy, info);
+    RRCheckExtension (dpy, info, None);
 
     LockDisplay(dpy);
     GetReq (RRCreateMode, req);

commit 2db939e82c29fa3ab868bac9d2b54de18419004b
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Dec 17 11:24:33 2008 -0500

    Fix type of GetReq() argument.

diff --git a/src/XrrOutput.c b/src/XrrOutput.c
index 3e41242..9545cbe 100644
--- a/src/XrrOutput.c
+++ b/src/XrrOutput.c
@@ -178,7 +178,7 @@ XRRGetOutputPrimary(Display *dpy, Window window)
 	return None;
 
     LockDisplay(dpy);
-    GetReq (RRSetOutputPrimary, req);
+    GetReq (RRGetOutputPrimary, req);
     req->reqType	= info->codes->major_opcode;
     req->randrReqType	= X_RRGetOutputProperty;
     req->window		= window;

commit c79e2aecab080d8f47b258ae3c4dd9394280ae2a
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Dec 17 11:23:51 2008 -0500

    Use RRSimpleCheckExtension in functions returning void

diff --git a/src/XrrOutput.c b/src/XrrOutput.c
index bc35fd1..3e41242 100644
--- a/src/XrrOutput.c
+++ b/src/XrrOutput.c
@@ -145,7 +145,7 @@ XRRSetOutputPrimary(Display *dpy, Window window, RROutput output)
     int			    i;
     int			    major_version, minor_version;
 
-    RRCheckExtension (dpy, info, 0);
+    RRSimpleCheckExtension (dpy, info);
 
     if (!XRRQueryVersion (dpy, &major_version, &minor_version) || 
 	!_XRRHasOutputPrimary (major_version, minor_version))

commit dda80ea67e33d18f7cc869c6f828c444c8966704
Author: Matthias Hopf <mhopf@suse.de>
Date:   Fri Dec 12 13:04:57 2008 +0100

    Bump to 1.2.99.3

diff --git a/configure.ac b/configure.ac
index 976cbc5..904bac8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,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.99.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXrandr)
+AC_INIT(libXrandr, 1.2.99.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXrandr)
 AC_CONFIG_AUX_DIR(.)
 AM_INIT_AUTOMAKE([dist-bzip2])
 AM_MAINTAINER_MODE

commit 59c8812099f33d56b43044f999ffe5df16adf5ff
Author: Adam Jackson <ajax@redhat.com>
Date:   Mon Dec 8 15:37:53 2008 -0500

    Add [GS]etOutputPrimary

diff --git a/include/X11/extensions/Xrandr.h b/include/X11/extensions/Xrandr.h
index 80d9d47..a411321 100644
--- a/include/X11/extensions/Xrandr.h
+++ b/include/X11/extensions/Xrandr.h
@@ -2,6 +2,7 @@
  * Copyright © 2000 Compaq Computer Corporation, Inc.
  * Copyright © 2002 Hewlett-Packard Company, Inc.
  * Copyright © 2006 Intel Corporation
+ * Copyright © 2008 Red Hat, Inc.
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -440,6 +441,15 @@ XRRSetPanning (Display *dpy,
 	       RRCrtc crtc,
 	       XRRPanning *panning);
 
+void
+XRRSetOutputPrimary(Display *dpy,
+		    Window window,
+		    RROutput output);
+
+RROutput
+XRRGetOutputPrimary(Display *dpy,
+		    Window window);
+
 _XFUNCPROTOEND
 
 #endif /* _XRANDR_H_ */
diff --git a/src/XrrOutput.c b/src/XrrOutput.c
index 1fe03ae..bc35fd1 100644
--- a/src/XrrOutput.c
+++ b/src/XrrOutput.c
@@ -1,5 +1,6 @@
 /*
  * Copyright © 2006 Keith Packard
+ * Copyright © 2008 Red Hat, Inc.
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -129,3 +130,64 @@ XRRFreeOutputInfo (XRROutputInfo *outputInfo)
 {
     Xfree (outputInfo);
 }
+
+static Bool
+_XRRHasOutputPrimary (int major, int minor)
+{
+    return major > 1 || (major == 1 && minor >= 3);
+}
+
+void
+XRRSetOutputPrimary(Display *dpy, Window window, RROutput output)
+{
+    XExtDisplayInfo	    *info = XRRFindDisplay(dpy);
+    xRRSetOutputPrimaryReq  *req;
+    int			    i;
+    int			    major_version, minor_version;
+
+    RRCheckExtension (dpy, info, 0);
+
+    if (!XRRQueryVersion (dpy, &major_version, &minor_version) || 
+	!_XRRHasOutputPrimary (major_version, minor_version))
+	return;
+
+    LockDisplay(dpy);
+    GetReq (RRSetOutputPrimary, req);
+    req->reqType       = info->codes->major_opcode;
+    req->randrReqType  = X_RRSetOutputPrimary;
+    req->window        = window;
+    req->output	       = output;
+
+    UnlockDisplay (dpy);
+    SyncHandle ();
+}
+
+RROutput
+XRRGetOutputPrimary(Display *dpy, Window window)
+{
+    XExtDisplayInfo	    *info = XRRFindDisplay(dpy);
+    xRRGetOutputPrimaryReq  *req;
+    xRRGetOutputPrimaryReply rep;
+    int			    i;
+    int			    major_version, minor_version;
+
+    RRCheckExtension (dpy, info, 0);
+
+    if (!XRRQueryVersion (dpy, &major_version, &minor_version) || 
+	!_XRRHasOutputPrimary (major_version, minor_version))
+	return None;
+
+    LockDisplay(dpy);
+    GetReq (RRSetOutputPrimary, req);
+    req->reqType	= info->codes->major_opcode;
+    req->randrReqType	= X_RRGetOutputProperty;
+    req->window		= window;
+
+    if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
+	rep.output = None;
+	
+    UnlockDisplay(dpy);
+    SyncHandle();
+
+    return rep.output;
+}


Reply to: