diff options
author | Philip Langdale <philipl@fido2.homeip.net> | 2007-02-09 11:09:17 -0800 |
---|---|---|
committer | Philip Langdale <philipl@fido2.homeip.net> | 2007-02-09 11:09:17 -0800 |
commit | a283c62c1db9e25ba11c6d72e4d00e0d911d64a2 (patch) | |
tree | 3b3925b216eed67b526fe032ea34efda5bed28f8 /src | |
parent | f4540555dc8c823dfec53dddeb82e2b7b0dbfe3d (diff) |
Filter out default modes that are larger than the hardware
maxmimum size and add an explicit mode for the hardware
maximum.
Diffstat (limited to 'src')
-rw-r--r-- | src/vmware.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/vmware.c b/src/vmware.c index dabf352..e02e2fa 100644 --- a/src/vmware.c +++ b/src/vmware.c @@ -1584,11 +1584,18 @@ VMWAREScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) unsigned int numModes = sizeof (VMWAREDefaultModes) / sizeof *(VMWAREDefaultModes); char name[10]; for (i = 0; i < numModes; i++) { - snprintf(name, 10, "%dx%d", - VMWAREDefaultModes[i].width, VMWAREDefaultModes[i].height); - VMWAREAddDisplayMode(pScrn, name, VMWAREDefaultModes[i].width, - VMWAREDefaultModes[i].height); + const VMWAREDefaultMode *mode = &VMWAREDefaultModes[i]; + + /* Only modes that fit the hardware maximums should be added. */ + if (mode->width <= pVMWARE->maxWidth && mode->height <= pVMWARE->maxHeight) { + snprintf(name, 10, "%dx%d", mode->width, mode->height); + VMWAREAddDisplayMode(pScrn, name, mode->width, mode->height); + } } + + /* Add the hardware maximums as a mode. */ + snprintf(name, 10, "%dx%d", pVMWARE->maxWidth, pVMWARE->maxHeight); + VMWAREAddDisplayMode(pScrn, name, pVMWARE->maxWidth, pVMWARE->maxHeight); } /* |