aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/randr/rrscreen.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-12-07 15:49:06 +0000
committermarha <marha@users.sourceforge.net>2010-12-07 15:49:06 +0000
commit25b9dbb15f0dc98cfc6b5585e7efebf3250f64d3 (patch)
tree93007a6f77999699b0077f448c08b3d505662f55 /xorg-server/randr/rrscreen.c
parentc82036153f9273a6041426fb98e69fff0806680e (diff)
downloadvcxsrv-25b9dbb15f0dc98cfc6b5585e7efebf3250f64d3.tar.gz
vcxsrv-25b9dbb15f0dc98cfc6b5585e7efebf3250f64d3.tar.bz2
vcxsrv-25b9dbb15f0dc98cfc6b5585e7efebf3250f64d3.zip
xserver pixman git update 7-12-2010
Diffstat (limited to 'xorg-server/randr/rrscreen.c')
-rw-r--r--xorg-server/randr/rrscreen.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/xorg-server/randr/rrscreen.c b/xorg-server/randr/rrscreen.c
index 6f842fe62..318dfaa91 100644
--- a/xorg-server/randr/rrscreen.c
+++ b/xorg-server/randr/rrscreen.c
@@ -168,6 +168,8 @@ Bool
RRScreenSizeSet (ScreenPtr pScreen,
CARD16 width,
CARD16 height,
+ CARD16 pixWidth,
+ CARD16 pixHeight,
CARD32 mmWidth,
CARD32 mmHeight)
{
@@ -178,6 +180,7 @@ RRScreenSizeSet (ScreenPtr pScreen,
{
return (*pScrPriv->rrScreenSetSize) (pScreen,
width, height,
+ pixWidth, pixHeight,
mmWidth, mmHeight);
}
#endif
@@ -191,6 +194,24 @@ RRScreenSizeSet (ScreenPtr pScreen,
}
/*
+ * Compute an RRScreenConfig from the current screen information
+ */
+void
+RRScreenCurrentConfig(ScreenPtr screen,
+ RRScreenConfigPtr screen_config)
+{
+ PixmapPtr screen_pixmap = screen->GetScreenPixmap(screen);
+ WindowPtr root = screen->root;
+
+ screen_config->screen_pixmap_width = screen_pixmap->drawable.width;
+ screen_config->screen_pixmap_height = screen_pixmap->drawable.height;
+ screen_config->screen_width = root->drawable.width;
+ screen_config->screen_height = root->drawable.height;
+ screen_config->mm_width = screen->mmWidth;
+ screen_config->mm_height = screen->mmHeight;
+}
+
+/*
* Retrieve valid screen size range
*/
int
@@ -300,6 +321,7 @@ ProcRRSetScreenSize (ClientPtr client)
}
if (!RRScreenSizeSet (pScreen,
stuff->width, stuff->height,
+ stuff->width, stuff->height,
stuff->widthInMillimeters,
stuff->heightInMillimeters))
{
@@ -776,8 +798,10 @@ ProcRRSetScreenConfig (ClientPtr client)
}
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess);
- if (rc != Success)
+ if (rc != Success) {
+ client->errorValue = stuff->drawable;
return rc;
+ }
pScreen = pDraw->pScreen;
@@ -922,14 +946,14 @@ ProcRRSetScreenConfig (ClientPtr client)
for (c = 0; c < pScrPriv->numCrtcs; c++)
{
if (!RRCrtcSet (pScrPriv->crtcs[c], NULL, 0, 0, RR_Rotate_0,
- 0, NULL))
+ 0, NULL, NULL))
{
rep.status = RRSetConfigFailed;
/* XXX recover from failure */
goto sendReply;
}
}
- if (!RRScreenSizeSet (pScreen, width, height,
+ if (!RRScreenSizeSet (pScreen, width, height, width, height,
pScreen->mmWidth, pScreen->mmHeight))
{
rep.status = RRSetConfigFailed;
@@ -938,7 +962,7 @@ ProcRRSetScreenConfig (ClientPtr client)
}
}
- if (!RRCrtcSet (crtc, mode, 0, 0, stuff->rotation, 1, &output))
+ if (!RRCrtcSet (crtc, mode, 0, 0, stuff->rotation, 1, &output, NULL))
rep.status = RRSetConfigFailed;
else {
pScrPriv->lastSetTime = time;