summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@guitar.keithp.com>2006-10-03 21:03:10 -0700
committerKeith Packard <keithp@guitar.keithp.com>2006-10-03 21:03:10 -0700
commitdd0fb435a0168d4041ecd81024d6493295651c61 (patch)
tree2702741708910e7ad682aa7d878c335507004617
parentcb1dbb7c2446ddf514ee709fba940cc4e75438a0 (diff)
Add mode origins and output options.
-rw-r--r--include/X11/extensions/Xrandr.h12
-rw-r--r--src/XrrCrtc.c6
-rw-r--r--src/XrrOutput.c8
-rw-r--r--src/XrrScreen.c1
4 files changed, 21 insertions, 6 deletions
diff --git a/include/X11/extensions/Xrandr.h b/include/X11/extensions/Xrandr.h
index f56331c..827dcdc 100644
--- a/include/X11/extensions/Xrandr.h
+++ b/include/X11/extensions/Xrandr.h
@@ -206,6 +206,8 @@ XRRSetScreenSize (Display *dpy, Window window,
int mmWidth, int mmHeight);
typedef unsigned long XRRModeFlags;
+typedef unsigned int XRRModeOrigin;
+typedef unsigned int XRROutputOptions;
typedef struct _XRRModeInfo {
RRMode id;
@@ -224,8 +226,14 @@ typedef struct _XRRModeInfo {
char *name;
unsigned int nameLength;
XRRModeFlags modeFlags;
+ XRRModeOrigin origin;
} XRRModeInfo;
+typedef struct _XRROutputConfig {
+ RROutput output;
+ XRROutputOptions options;
+} XRROutputConfig;
+
typedef struct _XRRScreenResources {
Time timestamp;
Time configTimestamp;
@@ -248,8 +256,10 @@ typedef struct _XRROutputInfo {
RRCrtc crtc;
char *name;
int nameLen;
+ XRROutputOptions current_options;
Connection connection;
SubpixelOrder subpixel_order;
+ XRROutputOptions possible_options;
int ncrtc;
RRCrtc *crtcs;
int nclone;
@@ -329,7 +339,7 @@ XRRSetCrtcConfig (Display *dpy,
int x, int y,
RRMode mode,
Rotation rotation,
- RROutput *outputs,
+ XRROutputConfig *outputs,
int noutputs);
int
diff --git a/src/XrrCrtc.c b/src/XrrCrtc.c
index a1372a1..535327e 100644
--- a/src/XrrCrtc.c
+++ b/src/XrrCrtc.c
@@ -121,7 +121,7 @@ XRRSetCrtcConfig (Display *dpy,
int x, int y,
RRMode mode,
Rotation rotation,
- RROutput *outputs,
+ XRROutputConfig *outputs,
int noutputs)
{
XExtDisplayInfo *info = XRRFindDisplay(dpy);
@@ -135,7 +135,7 @@ XRRSetCrtcConfig (Display *dpy,
GetReq (RRSetCrtcConfig, req);
req->reqType = info->codes->major_opcode;
req->randrReqType = X_RRSetCrtcConfig;
- req->length += noutputs;
+ req->length += noutputs << 1;
req->crtc = crtc;
req->timestamp = timestamp;
req->configTimestamp = resources->configTimestamp;
@@ -143,7 +143,7 @@ XRRSetCrtcConfig (Display *dpy,
req->y = y;
req->mode = mode;
req->rotation = rotation;
- Data32 (dpy, outputs, noutputs << 2);
+ Data32 (dpy, outputs, noutputs << 3);
if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
rep.status = RRSetConfigFailed;
diff --git a/src/XrrOutput.c b/src/XrrOutput.c
index 1c93660..872a83a 100644
--- a/src/XrrOutput.c
+++ b/src/XrrOutput.c
@@ -32,6 +32,8 @@
#include <X11/extensions/Xrender.h>
#include "Xrandrint.h"
+#define OutputInfoExtra (SIZEOF(xRRGetOutputInfoReply) - 32)
+
XRROutputInfo *
XRRGetOutputInfo (Display *dpy, XRRScreenResources *resources, RROutput output)
{
@@ -52,14 +54,14 @@ XRRGetOutputInfo (Display *dpy, XRRScreenResources *resources, RROutput output)
req->output = output;
req->configTimestamp = resources->configTimestamp;
- if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
+ if (!_XReply (dpy, (xReply *) &rep, OutputInfoExtra >> 2, xFalse))
{
UnlockDisplay (dpy);
SyncHandle ();
return NULL;
}
- nbytes = (long) rep.length << 2;
+ nbytes = ((long) (rep.length) << 2) - OutputInfoExtra;
nbytesRead = (long) (rep.nCrtcs * 4 +
rep.nModes * 4 +
@@ -88,8 +90,10 @@ XRRGetOutputInfo (Display *dpy, XRRScreenResources *resources, RROutput output)
xoi->timestamp = rep.timestamp;
xoi->crtc = rep.crtc;
+ xoi->current_options = rep.currentOptions;
xoi->connection = rep.connection;
xoi->subpixel_order = rep.subpixelOrder;
+ xoi->possible_options = rep.possibleOptions;
xoi->ncrtc = rep.nCrtcs;
xoi->crtcs = (RRCrtc *) (xoi + 1);
xoi->nmode = rep.nModes;
diff --git a/src/XrrScreen.c b/src/XrrScreen.c
index 1b79c8f..37e3aed 100644
--- a/src/XrrScreen.c
+++ b/src/XrrScreen.c
@@ -162,6 +162,7 @@ XRRGetScreenResources (Display *dpy, Window window)
xrsr->modes[i].vTotal = modeInfo.vTotal;
xrsr->modes[i].nameLength = modeInfo.nameLength;
xrsr->modes[i].modeFlags = modeInfo.modeFlags;
+ xrsr->modes[i].origin = modeInfo.origin;
}
/*