summaryrefslogtreecommitdiff
path: root/randr/rrscreen.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@mandolin.keithp.com>2006-11-01 00:29:46 -0800
committerKeith Packard <keithp@mandolin.keithp.com>2006-11-01 00:29:46 -0800
commit4056e6e79a4e37101d298ae29139c83d3816368b (patch)
treebe8d982fb4855ac338d4113fb611f62fddc93a68 /randr/rrscreen.c
parente21604914dccece6bc64c69b55512d1f1a969235 (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/rrscreen.c')
-rw-r--r--randr/rrscreen.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index b4d361846..705e7d78c 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -126,8 +126,8 @@ RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen)
}
se.widthInPixels = mode->mode.width;
se.heightInPixels = mode->mode.height;
- se.widthInMillimeters = mode->mode.mmWidth;
- se.heightInMillimeters = mode->mode.mmHeight;
+ se.widthInMillimeters = pScreen->mmWidth;
+ se.heightInMillimeters = pScreen->mmHeight;
}
else
{
@@ -415,8 +415,6 @@ ProcRRGetScreenResources (ClientPtr client)
swapl (&modeinfos[i].id, n);
swaps (&modeinfos[i].width, n);
swaps (&modeinfos[i].height, n);
- swapl (&modeinfos[i].mmWidth, n);
- swapl (&modeinfos[i].mmHeight, n);
swapl (&modeinfos[i].dotClock, n);
swaps (&modeinfos[i].hSyncStart, n);
swaps (&modeinfos[i].hSyncEnd, n);
@@ -501,8 +499,13 @@ RR10GetData (ScreenPtr pScreen, RROutputPtr output)
size[j].id = j;
size[j].width = mode->mode.width;
size[j].height = mode->mode.height;
- size[j].mmWidth = mode->mode.mmWidth;
- size[j].mmHeight = mode->mode.mmHeight;
+ if (output->mmWidth && output->mmHeight) {
+ size[j].mmWidth = output->mmWidth;
+ size[j].mmHeight = output->mmHeight;
+ } else {
+ size[j].mmWidth = pScreen->mmWidth;
+ size[j].mmHeight = pScreen->mmHeight;
+ }
size[j].nRates = 0;
size[j].pRates = &refresh[data->nrefresh];
data->nsize++;