diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2010-04-12 20:18:13 +0100 |
---|---|---|
committer | Tiago Vignatti <tiago.vignatti@nokia.com> | 2010-04-23 15:55:17 +0300 |
commit | d8454ae488cfc073cd6010c9a08d53855a0c2612 (patch) | |
tree | 163e5a8907a05f39bf54543b7330e9f90ea3c61c /hw/xwin/InitOutput.c | |
parent | b61870595ba4df06006d24ed8c07cfe781bce1b7 (diff) |
Xwin: Simplify screen option processing
Use an instance of the XWin DDX-specific screen info structure to hold
the current default values, to simplify greatly the code for applying
options to all screens and remove all those loops over MAXSCREENS screens
in the command line option processing
Use g_iNumScreens for tracking the current initialized screen count
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/InitOutput.c')
-rw-r--r-- | hw/xwin/InitOutput.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index fd286de44..8c7ebf0ea 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -65,7 +65,6 @@ typedef HRESULT (*SHGETFOLDERPATHPROC)( extern int g_iNumScreens; extern winScreenInfo g_ScreenInfo[]; -extern int g_iLastScreen; extern char * g_pszCommandLine; extern Bool g_fSilentFatalError; @@ -115,9 +114,6 @@ void OsVendorVErrorF (const char *pszFormat, va_list va_args); #endif -void -winInitializeDefaultScreens (void); - static Bool winCheckDisplayNumber (void); @@ -716,22 +712,16 @@ OsVendorInit (void) /* Add a default screen if no screens were specified */ if (g_iNumScreens == 0) { - winDebug ("OsVendorInit - Creating bogus screen 0\n"); - - /* - * We need to initialize default screens if no arguments - * were processed. Otherwise, the default screens would - * already have been initialized by ddxProcessArgument (). - */ - winInitializeDefaultScreens (); + winDebug ("OsVendorInit - Creating default screen 0\n"); /* - * Add a screen 0 using the defaults set by - * winInitializeDefaultScreens () and any additional parameters - * processed by ddxProcessArgument (). + * We need to initialize the default screen 0 if no -screen + * arguments were processed. + * + * Add a screen 0 using the defaults set by winInitializeDefaultScreens() + * and any additional default screen parameters given */ - g_iNumScreens = 1; - g_iLastScreen = 0; + winInitializeScreens(1); /* We have to flag this as an explicit screen, even though it isn't */ g_ScreenInfo[0].fExplicitScreen = TRUE; |