diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2010-04-16 18:13:50 +0100 |
---|---|---|
committer | Tiago Vignatti <tiago.vignatti@nokia.com> | 2010-04-23 15:59:49 +0300 |
commit | a7d398e545a4be5491248d5ccb303aa03ee1594f (patch) | |
tree | affd1e09c3e22c57195e1e1923a546113a2a83f2 /hw/xwin/winprocarg.c | |
parent | d8454ae488cfc073cd6010c9a08d53855a0c2612 (diff) |
Xwin: make screens structures run-time adjustable
Change g_ScreenInfo, an array of winScreenInfo elements, from a
static array of MAXSCREENS elements, to a dynamically allocated one
Fix up the validation that -screen option screen numbers are
contiguous from zero (which possibly didn't work correctly before
anyhow)
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jamey Sharp<jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Diffstat (limited to 'hw/xwin/winprocarg.c')
-rwxr-xr-x | hw/xwin/winprocarg.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c index 540adf706..ad4b7e913 100755 --- a/hw/xwin/winprocarg.c +++ b/hw/xwin/winprocarg.c @@ -45,7 +45,7 @@ from The Open Group. */ extern int g_iNumScreens; -extern winScreenInfo g_ScreenInfo[]; +extern winScreenInfo * g_ScreenInfo; #ifdef XWIN_CLIPBOARD extern Bool g_fUnicodeClipboard; extern Bool g_fClipboard; @@ -227,6 +227,9 @@ winInitializeScreens(int maxscreens) if (maxscreens > g_iNumScreens) { + /* Reallocate the memory for DDX-specific screen info */ + g_ScreenInfo = realloc(g_ScreenInfo, maxscreens * sizeof (winScreenInfo)); + /* Set default values for any new screens */ for (i = g_iNumScreens; i < maxscreens ; i++) winInitializeScreen(i); @@ -353,7 +356,7 @@ ddxProcessArgument (int argc, char *argv[], int i) nScreenNum = atoi (argv[i + 1]); /* Validate the specified screen number */ - if (nScreenNum < 0 || nScreenNum >= MAXSCREENS) + if (nScreenNum < 0) { ErrorF ("ddxProcessArgument - screen - Invalid screen number %d\n", nScreenNum); |