diff options
Diffstat (limited to 'xorg-server/hw/xwin/InitOutput.c')
-rw-r--r-- | xorg-server/hw/xwin/InitOutput.c | 91 |
1 files changed, 56 insertions, 35 deletions
diff --git a/xorg-server/hw/xwin/InitOutput.c b/xorg-server/hw/xwin/InitOutput.c index abc35b943..d2c6e27b7 100644 --- a/xorg-server/hw/xwin/InitOutput.c +++ b/xorg-server/hw/xwin/InitOutput.c @@ -1,6 +1,7 @@ /* Copyright 1993, 1998 The Open Group +Copyright (C) Colin Harrison 2005-2008 Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that @@ -45,14 +46,16 @@ from The Open Group. #if defined(XKB) && defined(WIN32) #include <xkbsrv.h> #endif + #ifdef RELOCATE_PROJECTROOT +#undef Status #include <shlobj.h> -typedef HRESULT (*SHGETFOLDERPATHPROC)( +typedef HRESULT (__stdcall * SHGETFOLDERPATHPROC)( HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, - LPTSTR pszPath + LPSTR pszPath ); #endif @@ -67,12 +70,13 @@ extern int g_iLastScreen; extern char * g_pszCommandLine; extern Bool g_fSilentFatalError; -extern char * g_pszLogFile; +extern const char * g_pszLogFile; extern Bool g_fLogFileChanged; extern int g_iLogVerbose; Bool g_fLogInited; extern Bool g_fXdmcpEnabled; +extern Bool g_fAuthEnabled; #ifdef HAS_DEVWINDOWS extern int g_fdMessageQueue; #endif @@ -132,6 +136,9 @@ const char * winGetBaseDir(void); #endif +static +void glx_debugging(void); + /* * For the depth 24 pixmap we default to 32 bits per pixel, but * we change this pixmap format later if we detect that the display @@ -178,9 +185,6 @@ winClipboardShutdown (void) /* Wait for the clipboard thread to exit */ pthread_join (g_ptClipboardProc, NULL); - g_fClipboardLaunched = FALSE; - g_fClipboardStarted = FALSE; - winDebug ("winClipboardShutdown - Clipboard thread has exited.\n"); } } @@ -241,7 +245,7 @@ ddxGiveUp (void) #endif if (!g_fLogInited) { - LogInit (g_pszLogFile, NULL); + g_pszLogFile = LogInit (g_pszLogFile, NULL); g_fLogInited = TRUE; } LogClose (); @@ -424,7 +428,17 @@ winFixupPaths (void) #ifdef READ_FONTDIRS { /* Open fontpath configuration file */ +#if defined WIN32 && defined __MINGW32__ + static Bool once = False; + char buffer[MAX_PATH]; + snprintf(buffer, sizeof(buffer), "%s\\font-dirs", basedir); + buffer[sizeof(buffer)-1] = 0; + FILE *fontdirs = fopen(buffer, "rt"); + if (once) fontdirs = NULL; + else once = True; +#else FILE *fontdirs = fopen(ETCX11DIR "/font-dirs", "rt"); +#endif if (fontdirs != NULL) { char buffer[256]; @@ -624,6 +638,14 @@ winFixupPaths (void) buffer[sizeof(buffer)-1] = 0; putenv(buffer); } + if (getenv("XHOSTPREFIX") == NULL) + { + char buffer[MAX_PATH]; + snprintf(buffer, sizeof(buffer), "XHOSTPREFIX=%s\\X", + basedir); + buffer[sizeof(buffer)-1] = 0; + putenv(buffer); + } if (getenv("HOME") == NULL) { HMODULE shfolder; @@ -661,9 +683,10 @@ winFixupPaths (void) if (size && size < sizeof(buffer)) { snprintf(buffer + size, sizeof(buffer) - size, - "XWin.%s.log", display); + "VCXSrv.%s.log", display); buffer[sizeof(buffer)-1] = 0; g_pszLogFile = buffer; + GetLongPathName(buffer, buffer, MAX_PATH); winMsg (X_DEFAULT, "Logfile set to \"%s\"\n", g_pszLogFile); } } @@ -671,7 +694,7 @@ winFixupPaths (void) { static char xkbbasedir[MAX_PATH]; - snprintf(xkbbasedir, sizeof(xkbbasedir), "%s\\xkb", basedir); + snprintf(xkbbasedir, sizeof(xkbbasedir), "%s\\xkbdata", basedir); if (sizeof(xkbbasedir) > 0) xkbbasedir[sizeof(xkbbasedir)-1] = 0; XkbBaseDirectory = xkbbasedir; @@ -687,9 +710,6 @@ OsVendorInit (void) /* Re-initialize global variables on server reset */ winInitializeGlobals (); - LogInit (NULL, NULL); - LogSetParameter (XLOG_VERBOSITY, g_iLogVerbose); - winFixupPaths(); #ifdef DDXOSVERRORF @@ -704,7 +724,7 @@ OsVendorInit (void) * avoid the second call */ g_fLogInited = TRUE; - LogInit (g_pszLogFile, NULL); + g_pszLogFile = LogInit (g_pszLogFile, NULL); } LogSetParameter (XLOG_FLUSH, 1); LogSetParameter (XLOG_VERBOSITY, g_iLogVerbose); @@ -877,7 +897,7 @@ winUseMsg (void) #endif ErrorF ("-logfile filename\n" - "\tWrite logmessages to <filename> instead of /tmp/Xwin.log.\n"); + "\tWrite logmessages to <filename>.\n"); ErrorF ("-logverbose verbosity\n" "\tSet the verbosity of logmessages. [NOTE: Only a few messages\n" @@ -907,7 +927,7 @@ ddxUseMsg(void) /* Log file will not be opened for UseMsg unless we open it now */ if (!g_fLogInited) { - LogInit (g_pszLogFile, NULL); + g_pszLogFile = LogInit (g_pszLogFile, NULL); g_fLogInited = TRUE; } LogClose (); @@ -915,9 +935,9 @@ ddxUseMsg(void) /* Notify user where UseMsg text can be found.*/ if (!g_fNoHelpMessageBox) winMessageBoxF ("The " PROJECT_NAME " help text has been printed to " - "/tmp/XWin.log.\n" - "Please open /tmp/XWin.log to read the help text.\n", - MB_ICONINFORMATION); + "%s.\n" + "Please open %s to read the help text.\n", + MB_ICONINFORMATION, g_pszLogFile, g_pszLogFile); } /* See Porting Layer Definition - p. 20 */ @@ -960,9 +980,6 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[]) if (!winReadConfigfile ()) winErrorFVerb (1, "InitOutput - Error reading config file\n"); #else - winMsg(X_INFO, "XF86Config is not supported\n"); - winMsg(X_INFO, "See http://x.cygwin.com/docs/faq/cygwin-x-faq.html " - "for more information\n"); winConfigFiles (); #endif @@ -1026,7 +1043,7 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[]) #if defined(XCSECURITY) /* Generate a cookie used by internal clients for authorization */ - if (g_fXdmcpEnabled) + if (g_fXdmcpEnabled || g_fAuthEnabled) winGenerateAuthorization (); #endif @@ -1038,6 +1055,8 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[]) * Apply locale specified in LANG environment variable. */ setlocale (LC_ALL, ""); + + glx_debugging(); } #endif @@ -1066,7 +1085,7 @@ winCheckDisplayNumber () /* Check display range */ nDisp = atoi (display); - if (nDisp < 0 || nDisp > 65535) + if (nDisp < 0 || nDisp > 59535) { ErrorF ("winCheckDisplayNumber - Bad display number: %d\n", nDisp); return FALSE; @@ -1113,7 +1132,7 @@ winCheckDisplayNumber () if (GetLastError () == ERROR_ALREADY_EXISTS) { ErrorF ("winCheckDisplayNumber - " - PROJECT_NAME " is already running on display %d\n", + "VCXsrv, Xming or Cygwin/X is already running on display %d\n", nDisp); return FALSE; } @@ -1121,19 +1140,21 @@ winCheckDisplayNumber () return TRUE; } -#ifdef DPMSExtension -Bool DPMSSupported(void) -{ - return FALSE; -} +/* GLX debugging helpers */ +#include <../glx/glapi.h> -void DPMSSet(int level) -{ - return; +static +void warn_func(void * p1, const char *format, ...) { + va_list v; + va_start(v, format); + vfprintf(stderr, format, v); + va_end(v); + fprintf(stderr,"\n"); } -int DPMSGet(int *plevel) +static +void glx_debugging(void) { - return 0; + _glapi_set_warning_func(warn_func); + _glapi_noop_enable_warnings(TRUE); } -#endif |