Lazily allocate the dynamic modes used for pixel precise guest
resizing. They will not appear until they are neeed.
This commit is contained in:
Philip Langdale
2006-09-03 10:45:22 -07:00
parent 86aeab28b8
commit 0850feff70
4 changed files with 31 additions and 3 deletions

View File

@@ -1,3 +1,12 @@
2006-09-03 Philip langdale <plangdale@vmware.com>
* src/vmware.c:
* src/vmware.h:
* src/vmwarectrl.c:
Fix https://bugs.freedesktop.org/show_bug.cgi?id=8094
Lazily allocate the dynamic modes used for pixel precise guest
resizing. They will not appear until they are neeed.
2006-04-07 Adam Jackson <ajax@freedesktop.org>
* configure.ac:

View File

@@ -1164,7 +1164,7 @@ VMWARELoadPalette(ScrnInfoPtr pScrn, int numColors, int* indices,
}
static DisplayModeRec *
DisplayModeRec *
VMWAREAddDisplayMode(ScrnInfoPtr pScrn,
const char *name,
int width,
@@ -1414,8 +1414,13 @@ VMWAREScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
* at ScreenInit time.
*/
pVMWARE->initialMode = pScrn->currentMode;
pVMWARE->dynMode1 = VMWAREAddDisplayMode(pScrn, "DynMode1", 1, 1);
pVMWARE->dynMode2 = VMWAREAddDisplayMode(pScrn, "DynMode2", 2, 2);
/*
* We will lazily add the dynamic modes as the are needed when new
* modes are requested through the control extension.
*/
pVMWARE->dynMode1 = NULL;
pVMWARE->dynMode2 = NULL;
VMwareCtrl_ExtInit(pScrn);

View File

@@ -209,6 +209,13 @@ void vmwareSendSVGACmdUpdate(
VMWAREPtr pVMWARE, BoxPtr pBB
);
DisplayModeRec *VMWAREAddDisplayMode(
ScrnInfoPtr pScrn,
const char *name,
int width,
int height
);
/* vmwarecurs.c */
Bool vmwareCursorInit(
ScreenPtr pScr

View File

@@ -134,6 +134,13 @@ VMwareCtrlDoSetRes(ScrnInfoPtr pScrn,
mode = pVMWARE->dynMode1;
pVMWARE->dynMode1 = pVMWARE->dynMode2;
pVMWARE->dynMode2 = mode;
/*
* Initialise the dynamic mode if it hasn't been used before.
*/
if (!pVMWARE->dynMode1) {
pVMWARE->dynMode1 = VMWAREAddDisplayMode(pScrn, "DynMode", 1, 1);
}
mode = pVMWARE->dynMode1;
mode->HDisplay = x;