summaryrefslogtreecommitdiff
path: root/src/vmwarectrl.c
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@fido2.homeip.net>2007-02-08 10:33:14 -0800
committerPhilip Langdale <philipl@fido2.homeip.net>2007-02-08 10:33:14 -0800
commit3dc1ebc7c2c76f575b5150f1890ec13f8bd3e8a1 (patch)
tree10facee087470dbf8ce90ee5ebebe7793e819504 /src/vmwarectrl.c
parent188c2b44f0f47093092414f9364a52cc2d5016ad (diff)
Make resizing work once and for all.
This change removes the limitation on resizing larger than the initial size and removes the need for pitch-locking bu resizing the screen pixmap. Now the only limit on the screen size is the maximum width/height reported by the virtual hardware which is configured on the host side.
Diffstat (limited to 'src/vmwarectrl.c')
-rw-r--r--src/vmwarectrl.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/vmwarectrl.c b/src/vmwarectrl.c
index f57ad7e..f2c831d 100644
--- a/src/vmwarectrl.c
+++ b/src/vmwarectrl.c
@@ -113,18 +113,27 @@ VMwareCtrlQueryVersion(ClientPtr client)
static Bool
VMwareCtrlDoSetRes(ScrnInfoPtr pScrn,
CARD32 x,
- CARD32 y)
+ CARD32 y,
+ Bool resetXinerama)
{
DisplayModePtr mode;
VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
-
+
if (pScrn && pScrn->modes) {
+ VmwareLog(("DoSetRes: %d %d\n", x, y));
+
+ if (resetXinerama) {
+ xfree(pVMWARE->xineramaNextState);
+ pVMWARE->xineramaNextState = NULL;
+ pVMWARE->xineramaNextNumOutputs = 0;
+ }
+
/*
* Don't resize larger than possible but don't
* return an X Error either.
*/
- if (x > pVMWARE->initialMode->HDisplay ||
- y > pVMWARE->initialMode->VDisplay) {
+ if (x > pVMWARE->maxWidth ||
+ y > pVMWARE->maxHeight) {
return TRUE;
}
@@ -191,7 +200,7 @@ VMwareCtrlSetRes(ClientPtr client)
return BadMatch;
}
- if (!VMwareCtrlDoSetRes(pScrn, stuff->x, stuff->y)) {
+ if (!VMwareCtrlDoSetRes(pScrn, stuff->x, stuff->y, TRUE)) {
return BadValue;
}
@@ -250,6 +259,8 @@ VMwareCtrlDoSetTopology(ScrnInfoPtr pScrn,
maxY = MAX(maxY, extents[i].y_org + extents[i].height);
}
+ VmwareLog(("DoSetTopology: %d %d\n", maxX, maxY));
+
xineramaState = (VMWAREXineramaPtr)xcalloc(number, sizeof(VMWAREXineramaRec));
if (xineramaState) {
memcpy(xineramaState, extents, number * sizeof (VMWAREXineramaRec));
@@ -258,7 +269,7 @@ VMwareCtrlDoSetTopology(ScrnInfoPtr pScrn,
pVMWARE->xineramaNextState = xineramaState;
pVMWARE->xineramaNextNumOutputs = number;
- return VMwareCtrlDoSetRes(pScrn, maxX, maxY);
+ return VMwareCtrlDoSetRes(pScrn, maxX, maxY, FALSE);
} else {
return FALSE;
}