diff options
Diffstat (limited to 'hw/xwin/winprocarg.c')
-rw-r--r-- | hw/xwin/winprocarg.c | 163 |
1 files changed, 155 insertions, 8 deletions
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c index 837cdb2f4..8deac9d8a 100644 --- a/hw/xwin/winprocarg.c +++ b/hw/xwin/winprocarg.c @@ -135,13 +135,14 @@ winInitializeScreenDefaults(void) defaultScreenInfo.fRootless = FALSE; #ifdef XWIN_MULTIWINDOW defaultScreenInfo.fMultiWindow = FALSE; + defaultScreenInfo.fCompositeWM = FALSE; #endif #if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) defaultScreenInfo.fMultiMonitorOverride = FALSE; #endif defaultScreenInfo.fMultipleMonitors = FALSE; defaultScreenInfo.fLessPointer = FALSE; - defaultScreenInfo.iResizeMode = resizeWithRandr; + defaultScreenInfo.iResizeMode = resizeDefault; defaultScreenInfo.fNoTrayIcon = FALSE; defaultScreenInfo.iE3BTimeout = WIN_E3B_DEFAULT; defaultScreenInfo.fUseWinKillKey = WIN_DEFAULT_WIN_KILL; @@ -247,7 +248,7 @@ ddxProcessArgument(int argc, char *argv[], int i) * OsVendorInit () gets called, otherwise we will overwrite * settings changed by parameters such as -fullscreen, etc. */ - winErrorFVerb(2, "ddxProcessArgument - Initializing default " + winErrorFVerb(3, "ddxProcessArgument - Initializing default " "screens\n"); winInitializeScreenDefaults(); } @@ -292,6 +293,9 @@ ddxProcessArgument(int argc, char *argv[], int i) /* Display the usage message if the argument is malformed */ if (i + 1 >= argc) { + ErrorF("ddxProcessArgument - screen - Missing screen number\n"); + UseMsg(); + FatalError("-screen missing screen number\n"); return 0; } @@ -615,6 +619,16 @@ ddxProcessArgument(int argc, char *argv[], int i) /* Indicate that we have processed this argument */ return 1; } + + /* + * Look for the '-compositewm' argument + */ + if (IS_OPTION("-compositewm")) { + screenInfoPtr->fCompositeWM = TRUE; + + /* Indicate that we have processed this argument */ + return 1; + } #endif /* @@ -666,7 +680,7 @@ ddxProcessArgument(int argc, char *argv[], int i) if (IS_OPTION("-resize")) mode = resizeWithRandr; else if (IS_OPTION("-noresize")) - mode = notAllowed; + mode = resizeNotAllowed; else if (strncmp(argv[i], "-resize=", strlen("-resize=")) == 0) { char *option = argv[i] + strlen("-resize="); @@ -675,7 +689,7 @@ ddxProcessArgument(int argc, char *argv[], int i) else if (strcmp(option, "scrollbars") == 0) mode = resizeWithScrollbars; else if (strcmp(option, "none") == 0) - mode = notAllowed; + mode = resizeNotAllowed; else { ErrorF("ddxProcessArgument - resize - Invalid resize mode %s\n", option); @@ -957,6 +971,14 @@ ddxProcessArgument(int argc, char *argv[], int i) } /* + * Look for the '-dpi' argument + */ + if (IS_OPTION("-dpi")) { + g_cmdline.customDPI = TRUE; + return 0; /* Let DIX parse this again */ + } + + /* * Look for the '-config' argument */ if (IS_OPTION("-config") @@ -1011,9 +1033,6 @@ ddxProcessArgument(int argc, char *argv[], int i) if (IS_OPTION("-logfile")) { CHECK_ARGS(1); g_pszLogFile = argv[++i]; -#ifdef RELOCATE_PROJECTROOT - g_fLogFileChanged = TRUE; -#endif return 2; } @@ -1098,6 +1117,11 @@ ddxProcessArgument(int argc, char *argv[], int i) return 1; } + if (IS_OPTION("-nohostintitle")) { + g_fHostInTitle = FALSE; + return 1; + } + return 0; } @@ -1169,6 +1193,129 @@ winLogCommandLine(int argc, char *argv[]) } /* + * Detect the OS + */ + +typedef BOOL(WINAPI * LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); + +static void +winOS(void) +{ + OSVERSIONINFOEX osvi = { 0 }; + const char *windowstype = "Unknown"; + const char *prodName = "Unknown"; + const char *isWow = "Unknown"; + + /* Get operating system version information */ + osvi.dwOSVersionInfoSize = sizeof(osvi); + GetVersionEx((LPOSVERSIONINFO) & osvi); + + /* Branch on platform ID */ + switch (osvi.dwPlatformId) { + case VER_PLATFORM_WIN32_NT: + windowstype = "Windows NT"; + + if (osvi.dwMajorVersion <= 4) + prodName = "Windows NT"; + else if (osvi.dwMajorVersion == 10) { + if (osvi.dwMinorVersion == 0) { + if (osvi.wProductType == VER_NT_WORKSTATION) + prodName = "Windows 10"; + else + prodName = "Windows Server 10"; // or 2016??? + } + } + else if (osvi.dwMajorVersion == 6) { + if (osvi.dwMinorVersion == 4) { + if (osvi.wProductType == VER_NT_WORKSTATION) + prodName = "Windows 10"; + else + prodName = "Windows Server 10"; // or 2016??? + } + if (osvi.dwMinorVersion == 3) { + if (osvi.wProductType == VER_NT_WORKSTATION) + prodName = "Windows 8.1"; + else + prodName = "Windows Server 2012 R2"; + } + if (osvi.dwMinorVersion == 2) { + if (osvi.wProductType == VER_NT_WORKSTATION) + prodName = "Windows 8"; + else + prodName = "Windows Server 2012"; + } + else if (osvi.dwMinorVersion == 1) { + if (osvi.wProductType == VER_NT_WORKSTATION) + prodName = "Windows 7"; + else + prodName = "Windows Server 2008 R2"; + } + else if (osvi.dwMinorVersion == 0) { + if (osvi.wProductType == VER_NT_WORKSTATION) + prodName = "Windows Vista"; + else + prodName = "Windows Server 2008"; + } + } + else if (osvi.dwMajorVersion == 5) { + if (osvi.dwMinorVersion == 2) { + if (osvi.wProductType == VER_NT_WORKSTATION) + prodName = "Windows XP x64 Edition"; + else if (GetSystemMetrics(SM_SERVERR2)) + prodName = "Windows Server 2003 R2"; + else + prodName = "Windows Server 2003"; + } + else if (osvi.dwMinorVersion == 1) + prodName = "Windows XP"; + else if (osvi.dwMinorVersion == 0) { + prodName = "Windows 2000"; + break; + } + } + + break; + + case VER_PLATFORM_WIN32_WINDOWS: + windowstype = "Windows"; + break; + } + +#ifdef __x86_64__ + isWow = " (Win64)"; +#else + { + /* Check if we are running under WoW64 */ + LPFN_ISWOW64PROCESS fnIsWow64Process; + + fnIsWow64Process = + (LPFN_ISWOW64PROCESS) GetProcAddress(GetModuleHandle("kernel32"), + "IsWow64Process"); + if (NULL != fnIsWow64Process) { + wBOOL bIsWow64 = FALSE; + + if (fnIsWow64Process(GetCurrentProcess(), &bIsWow64)) { + isWow = bIsWow64 ? " (WoW64)" : " (Win32)"; + } + else { + /* IsWow64Process() failed */ + isWow = " (WoWUnknown)"; + } + } + else { + /* OS doesn't support IsWow64Process() */ + isWow = ""; + } + } +#endif + + ErrorF("OS: %s %s [%s %d.%d build %d]%s\n", + prodName, osvi.szCSDVersion, + windowstype, (int)osvi.dwMajorVersion, (int)osvi.dwMinorVersion, + (int)osvi.dwBuildNumber, isWow); +} + +/* * winLogVersionInfo - Log version information */ @@ -1195,8 +1342,8 @@ winLogVersionInfo(void) } } #endif + winOS(); if (strlen(BUILDERSTRING)) ErrorF("%s\n", BUILDERSTRING); - ErrorF("Contact: %s\n", BUILDERADDR); ErrorF("\n"); } |