diff options
Diffstat (limited to 'xorg-server/hw/xwin/InitOutput.c')
-rw-r--r-- | xorg-server/hw/xwin/InitOutput.c | 100 |
1 files changed, 62 insertions, 38 deletions
diff --git a/xorg-server/hw/xwin/InitOutput.c b/xorg-server/hw/xwin/InitOutput.c index 1ab059f72..2cd7bab08 100644 --- a/xorg-server/hw/xwin/InitOutput.c +++ b/xorg-server/hw/xwin/InitOutput.c @@ -48,13 +48,14 @@ from The Open Group. #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 @@ -131,6 +132,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 @@ -175,25 +179,11 @@ 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"); } } #endif -void -ddxPushProviders(void) -{ -#ifdef XWIN_GLX_WINDOWS - if (g_fNativeGl) - { - /* install the native GL provider */ - glxWinPushNativeProvider(); - } -#endif -} #if defined(DDXBEFORERESET) /* @@ -219,9 +209,7 @@ ddxGiveUp (void) { int i; -#if CYGDEBUG winDebug ("ddxGiveUp\n"); -#endif /* Perform per-screen deinitialization */ for (i = 0; i < g_iNumScreens; ++i) @@ -293,9 +281,7 @@ ddxGiveUp (void) void AbortDDX (void) { -#if CYGDEBUG winDebug ("AbortDDX\n"); -#endif ddxGiveUp (); } @@ -380,8 +366,10 @@ winCheckMount(void) return; } - if (!binary) - winMsg(X_WARNING, "/tmp mounted in textmode\n"); +#ifdef WINDBG + if (!binary) + winDebug("/tmp mounted in textmode\n"); +#endif } #else static void @@ -433,7 +421,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]; @@ -606,7 +604,7 @@ winFixupPaths (void) } #endif /* RELOCATE_PROJECTROOT */ if (changed_fontpath) - winMsg (font_from, "FontPath set to \"%s\"\n", defaultFontPath); + winDebug ("FontPath set to \"%s\"\n", defaultFontPath); #ifdef RELOCATE_PROJECTROOT if (getenv("XKEYSYMDB") == NULL) @@ -633,6 +631,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; @@ -659,7 +665,7 @@ winFixupPaths (void) putenv(buffer); } else { - winMsg (X_ERROR, "Can not determine HOME directory\n"); + ErrorF ("Can not determine HOME directory\n"); } if (shfolder != NULL) FreeLibrary(shfolder); @@ -670,16 +676,17 @@ 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; - winMsg (X_DEFAULT, "Logfile set to \"%s\"\n", g_pszLogFile); + GetLongPathName(buffer, buffer, MAX_PATH); + winDebug ("Logfile set to \"%s\"\n", g_pszLogFile); } } { 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; @@ -788,6 +795,9 @@ winUseMsg (void) "\t\t1 - Shadow GDI\n" "\t\t2 - Shadow DirectDraw\n" "\t\t4 - Shadow DirectDraw4 Non-Locking\n" +#ifdef XWIN_PRIMARYFB + "\t\t8 - Primary DirectDraw\n" +#endif #ifdef XWIN_NATIVEGDI "\t\t16 - Native GDI - experimental\n" #endif @@ -956,9 +966,7 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[]) /* Log the command line */ winLogCommandLine (argc, argv); -#if CYGDEBUG winDebug ("InitOutput\n"); -#endif /* Validate command-line arguments */ if (serverGeneration == 1 && !winValidateArgs ()) @@ -979,11 +987,8 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[]) #ifdef XWIN_XF86CONFIG /* Try to read the xorg.conf-style configuration file */ if (!winReadConfigfile ()) - winErrorFVerb (1, "InitOutput - Error reading config file\n"); + ErrorF ("InitOutput - Error reading config file\n"); #else - winMsg(X_INFO, "xorg.conf is not supported\n"); - winMsg(X_INFO, "See http://x.cygwin.com/docs/faq/cygwin-x-faq.html " - "for more information\n"); winConfigFiles (); #endif @@ -1017,7 +1022,7 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[]) "_TrackMouseEvent"); if (g_fpTrackMouseEvent == NULL) { - winErrorFVerb (1, "InitOutput - Could not get pointer to function\n" + ErrorF ("InitOutput - Could not get pointer to function\n" "\t_TrackMouseEvent in comctl32.dll. Try installing\n" "\tInternet Explorer 3.0 or greater if you have not\n" "\talready.\n"); @@ -1057,12 +1062,12 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[]) * Apply locale specified in LANG environment variable. */ setlocale (LC_ALL, ""); + + glx_debugging(); } #endif -#if CYGDEBUG || YES winDebug ("InitOutput - Returning.\n"); -#endif } @@ -1085,7 +1090,7 @@ winCheckDisplayNumber (void) /* 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; @@ -1132,10 +1137,29 @@ winCheckDisplayNumber (void) 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; } return TRUE; } + +/* GLX debugging helpers */ +#include <../glx/glapi.h> + +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"); +} + +static +void glx_debugging(void) +{ + _glapi_set_warning_func(warn_func); + _glapi_noop_enable_warnings(TRUE); +} |