diff options
author | Keith Packard <keithp@mandolin.keithp.com> | 2006-11-01 00:29:46 -0800 |
---|---|---|
committer | Keith Packard <keithp@mandolin.keithp.com> | 2006-11-01 00:29:46 -0800 |
commit | 4056e6e79a4e37101d298ae29139c83d3816368b (patch) | |
tree | be8d982fb4855ac338d4113fb611f62fddc93a68 /randr/rroutput.c | |
parent | e21604914dccece6bc64c69b55512d1f1a969235 (diff) |
Move physical size from mode to output.
Modes can be shared across different sized monitors this way.
Also caught some missing byteswapping and an incorrect return type.
Diffstat (limited to 'randr/rroutput.c')
-rw-r--r-- | randr/rroutput.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/randr/rroutput.c b/randr/rroutput.c index fc84ec1e6..1f6f33030 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -72,6 +72,8 @@ RROutputCreate (ScreenPtr pScreen, output->name[nameLength] = '\0'; output->connection = RR_UnknownConnection; output->subpixelOrder = SubPixelUnknown; + output->mmWidth = 0; + output->mmHeight = 0; output->crtc = NULL; output->currentOptions = 0; output->possibleOptions = 0; @@ -262,6 +264,20 @@ RROutputSetCurrentOptions (RROutputPtr output, return TRUE; } +Bool +RROutputSetPhysicalSize (RROutputPtr output, + int mmWidth, + int mmHeight) +{ + if (output->mmWidth == mmWidth && output->mmHeight == mmHeight) + return TRUE; + output->mmWidth = mmWidth; + output->mmHeight = mmHeight; + RROutputChanged (output); + return TRUE; +} + + void RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output) { @@ -381,6 +397,8 @@ ProcRRGetOutputInfo (ClientPtr client) rep.timestamp = pScrPriv->lastSetTime.milliseconds; rep.crtc = output->crtc ? output->crtc->id : None; rep.currentOptions = output->currentOptions; + rep.mmWidth = output->mmWidth; + rep.mmHeight = output->mmHeight; rep.connection = output->connection; rep.subpixelOrder = output->subpixelOrder; rep.nCrtcs = output->numCrtcs; @@ -434,10 +452,15 @@ ProcRRGetOutputInfo (ClientPtr client) swapl(&rep.length, n); swapl(&rep.timestamp, n); swapl(&rep.crtc, n); + swapl(&rep.currentOptions, n); + swapl(&rep.mmWidth, n); + swapl(&rep.mmHeight, n); swaps(&rep.nCrtcs, n); swaps(&rep.nModes, n); swaps(&rep.nClones, n); + swapl(&rep.possibleOptions, n); swaps(&rep.nameLength, n); + swapl(&rep.possibleOptions, n); } WriteToClient(client, sizeof(xRRGetOutputInfoReply), (char *)&rep); if (extraLen) |