diff options
Diffstat (limited to 'xorg-server/hw/xwin/winprocarg.c')
-rw-r--r-- | xorg-server/hw/xwin/winprocarg.c | 103 |
1 files changed, 75 insertions, 28 deletions
diff --git a/xorg-server/hw/xwin/winprocarg.c b/xorg-server/hw/xwin/winprocarg.c index 9bec84141..1418f78bc 100644 --- a/xorg-server/hw/xwin/winprocarg.c +++ b/xorg-server/hw/xwin/winprocarg.c @@ -44,6 +44,7 @@ from The Open Group. #ifdef XWIN_CLIPBOARD extern Bool g_fUnicodeClipboard; extern Bool g_fClipboard; +extern Bool g_fClipboardPrimary; #endif /* @@ -88,7 +89,7 @@ winInitializeScreenDefaults(void) dwWidth = GetSystemMetrics (SM_CXSCREEN); dwHeight = GetSystemMetrics (SM_CYSCREEN); - winErrorFVerb(2, "winInitializeScreenDefaults - primary monitor w %d h %d\n", (int) dwWidth, (int) dwHeight); + winDebug ("winInitializeScreenDefaults - primary monitor w %d h %d\n", (int) dwWidth, (int) dwHeight); /* Set a default DPI, if no '-dpi' option was used */ if (monitorResolution == 0) @@ -99,18 +100,19 @@ winInitializeScreenDefaults(void) int dpiX = GetDeviceCaps(hdc, LOGPIXELSX); int dpiY = GetDeviceCaps(hdc, LOGPIXELSY); - winErrorFVerb(2, "winInitializeDefaultScreens - native DPI x %d y %d\n", dpiX, dpiY); + winDebug("winInitializeDefaultScreens - native DPI x %d y %d\n", dpiX, dpiY); monitorResolution = dpiY; ReleaseDC(NULL, hdc); } else { - winErrorFVerb(1, "winInitializeDefaultScreens - Failed to retrieve native DPI, falling back to default of %d DPI\n", WIN_DEFAULT_DPI); + winDebug("winInitializeDefaultScreens - Failed to retrieve native DPI, falling back to default of %d DPI\n", WIN_DEFAULT_DPI); monitorResolution = WIN_DEFAULT_DPI; } } defaultScreenInfo.iMonitor = 1; + defaultScreenInfo.hMonitor = MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY); defaultScreenInfo.dwWidth = dwWidth; defaultScreenInfo.dwHeight = dwHeight; defaultScreenInfo.dwUserWidth = dwWidth; @@ -128,6 +130,8 @@ winInitializeScreenDefaults(void) defaultScreenInfo.fDecoration = TRUE; #ifdef XWIN_MULTIWINDOWEXTWM defaultScreenInfo.fMWExtWM = FALSE; +#endif +#ifdef XWIN_MULTIWINDOWINTWM defaultScreenInfo.fInternalWM = FALSE; #endif defaultScreenInfo.fRootless = FALSE; @@ -139,7 +143,7 @@ winInitializeScreenDefaults(void) #endif defaultScreenInfo.fMultipleMonitors = FALSE; defaultScreenInfo.fLessPointer = FALSE; - defaultScreenInfo.iResizeMode = notAllowed; + defaultScreenInfo.iResizeMode = resizeWithRandr; defaultScreenInfo.fNoTrayIcon = FALSE; defaultScreenInfo.iE3BTimeout = WIN_E3B_DEFAULT; defaultScreenInfo.fUseWinKillKey = WIN_DEFAULT_WIN_KILL; @@ -154,7 +158,7 @@ winInitializeScreenDefaults(void) static void winInitializeScreen(int i) { - winErrorFVerb (2, "winInitializeScreen - %d\n",i); + winDebug ("winInitializeScreen - %d\n",i); /* Initialize default screen values, if needed */ winInitializeScreenDefaults(); @@ -170,7 +174,7 @@ void winInitializeScreens(int maxscreens) { int i; - winErrorFVerb (2, "winInitializeScreens - %i\n", maxscreens); + winDebug ("winInitializeScreens - %i\n", maxscreens); if (maxscreens > g_iNumScreens) { @@ -246,15 +250,13 @@ 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 " + winDebug ("ddxProcessArgument - Initializing default " "screens\n"); winInitializeScreenDefaults(); } } -#if CYGDEBUG winDebug ("ddxProcessArgument - arg: %s\n", argv[i]); -#endif /* * Look for the '-help' and similar options @@ -288,10 +290,8 @@ ddxProcessArgument (int argc, char *argv[], int i) int iWidth, iHeight, iX, iY; int iMonitor; -#if CYGDEBUG winDebug ("ddxProcessArgument - screen - argc: %d i: %d\n", argc, i); -#endif /* Display the usage message if the argument is malformed */ if (i + 1 >= argc) @@ -329,11 +329,12 @@ ddxProcessArgument (int argc, char *argv[], int i) ErrorF ("ddxProcessArgument - screen - Querying monitors failed\n"); } else if (data.bMonitorSpecifiedExists == TRUE) { - winErrorFVerb(2, "ddxProcessArgument - screen - Found Valid ``@Monitor'' = %d arg\n", iMonitor); + winDebug("ddxProcessArgument - screen - Found Valid ``@Monitor'' = %d arg\n", iMonitor); iArgsProcessed = 3; g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = FALSE; g_ScreenInfo[nScreenNum].fUserGavePosition = TRUE; g_ScreenInfo[nScreenNum].iMonitor = iMonitor; + g_ScreenInfo[nScreenNum].hMonitor = data.monitorHandle; g_ScreenInfo[nScreenNum].dwWidth = data.monitorWidth; g_ScreenInfo[nScreenNum].dwHeight = data.monitorHeight; g_ScreenInfo[nScreenNum].dwUserWidth = data.monitorWidth; @@ -358,7 +359,7 @@ ddxProcessArgument (int argc, char *argv[], int i) (int *) &iWidth, (int *) &iHeight)) { - winErrorFVerb (2, "ddxProcessArgument - screen - Found ``WxD'' arg\n"); + winDebug ("ddxProcessArgument - screen - Found ``WxD'' arg\n"); iArgsProcessed = 3; g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = TRUE; g_ScreenInfo[nScreenNum].dwWidth = iWidth; @@ -370,7 +371,7 @@ ddxProcessArgument (int argc, char *argv[], int i) (int *) &iX, (int *) &iY)) { - winErrorFVerb (2, "ddxProcessArgument - screen - Found ``X+Y'' arg\n"); + winDebug("ddxProcessArgument - screen - Found ``X+Y'' arg\n"); g_ScreenInfo[nScreenNum].fUserGavePosition = TRUE; g_ScreenInfo[nScreenNum].dwInitialX = iX; g_ScreenInfo[nScreenNum].dwInitialY = iY; @@ -386,6 +387,7 @@ ddxProcessArgument (int argc, char *argv[], int i) } else if (data.bMonitorSpecifiedExists == TRUE) { g_ScreenInfo[nScreenNum].iMonitor = iMonitor; + g_ScreenInfo[nScreenNum].hMonitor = data.monitorHandle; g_ScreenInfo[nScreenNum].dwInitialX += data.monitorOffsetX; g_ScreenInfo[nScreenNum].dwInitialY += data.monitorOffsetY; } @@ -412,9 +414,10 @@ ddxProcessArgument (int argc, char *argv[], int i) ErrorF ("ddxProcessArgument - screen - Querying monitors failed\n"); } else if (data.bMonitorSpecifiedExists == TRUE) { - winErrorFVerb (2, "ddxProcessArgument - screen - Found Valid ``@Monitor'' = %d arg\n", iMonitor); + winDebug ("ddxProcessArgument - screen - Found Valid ``@Monitor'' = %d arg\n", iMonitor); g_ScreenInfo[nScreenNum].fUserGavePosition = TRUE; g_ScreenInfo[nScreenNum].iMonitor = iMonitor; + g_ScreenInfo[nScreenNum].hMonitor = data.monitorHandle; g_ScreenInfo[nScreenNum].dwInitialX = data.monitorOffsetX; g_ScreenInfo[nScreenNum].dwInitialY = data.monitorOffsetY; } @@ -436,7 +439,7 @@ ddxProcessArgument (int argc, char *argv[], int i) && 1 == sscanf (argv[i + 3], "%d", (int *) &iHeight)) { - winErrorFVerb (2, "ddxProcessArgument - screen - Found ``W D'' arg\n"); + winDebug ("ddxProcessArgument - screen - Found ``W D'' arg\n"); iArgsProcessed = 4; g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = TRUE; g_ScreenInfo[nScreenNum].dwWidth = iWidth; @@ -449,7 +452,7 @@ ddxProcessArgument (int argc, char *argv[], int i) && 1 == sscanf (argv[i + 5], "%d", (int *) &iY)) { - winErrorFVerb (2, "ddxProcessArgument - screen - Found ``X Y'' arg\n"); + winDebug ("ddxProcessArgument - screen - Found ``X Y'' arg\n"); iArgsProcessed = 6; g_ScreenInfo[nScreenNum].fUserGavePosition = TRUE; g_ScreenInfo[nScreenNum].dwInitialX = iX; @@ -458,7 +461,7 @@ ddxProcessArgument (int argc, char *argv[], int i) } else { - winErrorFVerb (2, "ddxProcessArgument - screen - Did not find size arg. " + ErrorF ("ddxProcessArgument - screen - Did not find size arg. " "dwWidth: %d dwHeight: %d\n", (int) g_ScreenInfo[nScreenNum].dwWidth, (int) g_ScreenInfo[nScreenNum].dwHeight); @@ -589,7 +592,9 @@ ddxProcessArgument (int argc, char *argv[], int i) /* Indicate that we have processed this argument */ return 1; } - /* +#endif +#ifdef XWIN_MULTIWINDOWINTWM + /* * Look for the '-internalwm' argument */ if (IS_OPTION ("-internalwm")) @@ -741,6 +746,30 @@ ddxProcessArgument (int argc, char *argv[], int i) /* Indicate that we have processed this argument */ return 1; } + + /* + * Look for the '-clipboard' argument + */ + if (IS_OPTION ("-clipboardprimary")) + { + /* Now the default, we still accept the arg for backwards compatibility */ + g_fClipboardPrimary = TRUE; + + /* Indicate that we have processed this argument */ + return 1; + } + + /* + * Look for the '-noclipboard' argument + */ + if (IS_OPTION ("-noclipboardprimary")) + { + g_fClipboardPrimary = FALSE; + + /* Indicate that we have processed this argument */ + return 1; + } + #endif @@ -788,7 +817,7 @@ ddxProcessArgument (int argc, char *argv[], int i) return iArgsProcessed; } - /* + /* * Look for the '-noemulate3buttons' argument */ if (IS_OPTION ("-noemulate3buttons")) @@ -1136,12 +1165,28 @@ ddxProcessArgument (int argc, char *argv[], int i) g_fNativeGl = TRUE; return 1; } - - if (IS_OPTION("-nowgl")) + else if (IS_OPTION("-nowgl")) { g_fNativeGl = FALSE; return 1; } + else if (IS_OPTION("-swrastwgl")) + { + g_fswrastwgl = TRUE; + return 1; + } + else if (IS_OPTION("-parentprocessid")) + { + DWORD dwProcessId; + CHECK_ARGS (1); + dwProcessId = atoi(argv[++i]); + if (!AllowSetForegroundWindow(dwProcessId)) + { + winMessageBoxF ("Error calling AllowSetForegroundWindow.", MB_ICONINFORMATION); + return 0; + } + return 2; + } return 0; } @@ -1214,7 +1259,7 @@ winLogCommandLine (int argc, char *argv[]) iCurrLen += strlen (argv[i]); } - ErrorF ("XWin was started with the following command line:\n\n" + winDebug ("XWin was started with the following command line:\n\n" "%s\n\n", g_pszCommandLine); } @@ -1226,15 +1271,17 @@ winLogCommandLine (int argc, char *argv[]) void winLogVersionInfo (void) { +#ifdef WINDBG static Bool s_fBeenHere = FALSE; if (s_fBeenHere) return; s_fBeenHere = TRUE; - ErrorF ("Welcome to the XWin X Server\n"); - ErrorF ("Vendor: %s\n", XVENDORNAME); - ErrorF ("Release: %d.%d.%d.%d (%d)\n", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, XORG_VERSION_CURRENT); - ErrorF ("%s\n\n", BUILDERSTRING); - ErrorF ("Contact: %s\n", BUILDERADDR); + winDebug ("Welcome to the VcXsrv X Server\n"); + winDebug ("Vendor: %s\n", XVENDORNAME); + winDebug ("Release: %d.%d.%d.%d\n\n", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP); + winDebug ("%s\n\n", BUILDERSTRING); + winDebug ("Contact: %s\n\n", BUILDERADDR); +#endif } |