aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/InitOutput.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/InitOutput.c')
-rw-r--r--xorg-server/hw/xwin/InitOutput.c115
1 files changed, 67 insertions, 48 deletions
diff --git a/xorg-server/hw/xwin/InitOutput.c b/xorg-server/hw/xwin/InitOutput.c
index 4d0df110f..ceb71ff07 100644
--- a/xorg-server/hw/xwin/InitOutput.c
+++ b/xorg-server/hw/xwin/InitOutput.c
@@ -35,12 +35,10 @@ from The Open Group.
#include "winmsg.h"
#include "winconfig.h"
#include "winprefs.h"
-#ifdef XWIN_CLIPBOARD
-#include "X11/Xlocale.h"
-#endif
#ifdef DPMSExtension
#include "dpmsproc.h"
#endif
+#include <locale.h>
#ifdef __CYGWIN__
#include <mntent.h>
#endif
@@ -48,11 +46,12 @@ from The Open Group.
#include "xkbsrv.h"
#endif
#ifdef RELOCATE_PROJECTROOT
+#undef Status
#include <shlobj.h>
-typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner,
- int nFolder,
- HANDLE hToken,
- DWORD dwFlags, LPTSTR pszPath);
+typedef HRESULT (__stdcall * SHGETFOLDERPATHPROC)(HWND hwndOwner,
+ int nFolder,
+ HANDLE hToken,
+ DWORD dwFlags, LPTSTR pszPath);
#endif
/*
@@ -130,6 +129,7 @@ winClipboardShutdown(void)
if (g_fClipboard && g_fClipboardLaunched && g_fClipboardStarted) {
/* Synchronously destroy the clipboard window */
if (g_hwndClipboard != NULL) {
+ g_fClipboardStarted=FALSE; /* This is to avoid dead-locls caused by the clipboard thread still doing some stuff */
SendMessage(g_hwndClipboard, WM_DESTROY, 0, 0);
/* NOTE: g_hwndClipboard is set to NULL in winclipboardthread.c */
}
@@ -139,24 +139,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)
/*
@@ -181,9 +168,7 @@ ddxGiveUp(enum ExitCode error)
{
int i;
-#if CYGDEBUG
winDebug("ddxGiveUp\n");
-#endif
/* Perform per-screen deinitialization */
for (i = 0; i < g_iNumScreens; ++i) {
@@ -193,6 +178,9 @@ ddxGiveUp(enum ExitCode error)
}
#ifdef XWIN_MULTIWINDOW
+ /* Unload libraries for taskbar grouping */
+ winTaskbarDestroy ();
+
/* Notify the worker threads we're exiting */
winDeinitMultiWindowWM();
#endif
@@ -235,9 +223,7 @@ ddxGiveUp(enum ExitCode error)
void
AbortDDX(enum ExitCode error)
{
-#if CYGDEBUG
winDebug("AbortDDX\n");
-#endif
ddxGiveUp(error);
}
@@ -320,8 +306,10 @@ winCheckMount(void)
return;
}
+#ifdef WINDBG
if (!binary)
- winMsg(X_WARNING, "/tmp mounted in textmode\n");
+ winDebug("/tmp mounted in textmode\n");
+#endif
}
#else
static void
@@ -373,8 +361,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];
int needs_sep = TRUE;
@@ -538,7 +535,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) {
@@ -562,6 +559,13 @@ 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) {
char buffer[MAX_PATH + 5];
@@ -574,7 +578,7 @@ winFixupPaths(void)
putenv(buffer);
}
else {
- winMsg(X_ERROR, "Can not determine HOME directory\n");
+ ErrorF ("Can not determine HOME directory\n");
}
}
if (!g_fLogFileChanged) {
@@ -583,16 +587,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;
@@ -664,8 +669,7 @@ OsVendorInit(void)
g_ScreenInfo[j].iE3BTimeout = WIN_DEFAULT_E3B_TIME;
if (reportOnce) {
reportOnce = FALSE;
- winMsg(X_PROBED,
- "Windows reports only %d mouse buttons, defaulting to -emulate3buttons\n",
+ winDebug("Windows reports only %d mouse buttons, defaulting to -emulate3buttons\n",
mouseButtons);
}
}
@@ -677,6 +681,7 @@ OsVendorInit(void)
}
}
+
static void
winUseMsg(void)
{
@@ -688,6 +693,10 @@ winUseMsg(void)
#ifdef XWIN_CLIPBOARD
ErrorF("-[no]clipboard\n"
"\tEnable [disable] the clipboard integration. Default is enabled.\n");
+ ErrorF ("-[no]clipboardprimary\n"
+ "\t[Do not] map the PRIMARY selection to the windows clipboard.\n"
+ "\tThe CLIPBOARD selection is always mapped if -clipboard is enabled.\n"
+ "\tDefault is mapped.\n");
#endif
ErrorF("-clipupdates num_boxes\n"
@@ -735,7 +744,7 @@ winUseMsg(void)
ErrorF("-ignoreinput\n" "\tIgnore keyboard and mouse input.\n");
-#ifdef XWIN_MULTIWINDOWEXTWM
+#ifdef XWIN_MULTIWINDOWINTWM
ErrorF("-internalwm\n" "\tRun the internal window manager.\n");
#endif
@@ -793,7 +802,7 @@ winUseMsg(void)
ErrorF("-resize=none|scrollbars|randr"
"\tIn windowed mode, [don't] allow resizing of the window. 'scrollbars'\n"
"\tmode gives the window scrollbars as needed, 'randr' mode uses the RANR\n"
- "\textension to resize the X screen.\n");
+ "\textension to resize the X screen. 'randr' is the default.\n");
ErrorF("-rootless\n" "\tRun the server in rootless mode.\n");
@@ -824,10 +833,11 @@ winUseMsg(void)
ErrorF("-[no]unixkill\n" "\tCtrl+Alt+Backspace exits the X Server.\n");
-#ifdef XWIN_GLX_WINDOWS
ErrorF("-[no]wgl\n"
"\tEnable the GLX extension to use the native Windows WGL interface for accelerated OpenGL\n");
-#endif
+
+ ErrorF ("-swrastwgl\n"
+ "\tEnable the GLX extension to use the native Windows WGL interface based on the swrast interface for accelerated OpenGL\n");
ErrorF("-[no]winkill\n" "\tAlt+F4 exits the X Server.\n");
@@ -888,9 +898,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()) {
@@ -909,11 +917,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
@@ -938,6 +943,11 @@ InitOutput(ScreenInfo * screenInfo, int argc, char *argv[])
/* Detect supported engines */
winDetectSupportedEngines();
+#ifdef XWIN_MULTIWINDOW
+ /* Load libraries for taskbar grouping */
+ winTaskbarInit ();
+#endif
+
/* Store the instance handle */
g_hInstance = GetModuleHandle(NULL);
@@ -961,13 +971,22 @@ InitOutput(ScreenInfo * screenInfo, int argc, char *argv[])
* setlocale applies to all threads in the current process.
* Apply locale specified in LANG environment variable.
*/
- setlocale(LC_ALL, "");
+ if (!setlocale (LC_ALL, ""))
+ {
+ ErrorF ("setlocale failed.\n");
+ }
+
+ /* See if X supports the current locale */
+ if (XSupportsLocale () == FALSE)
+ {
+ ErrorF ("Warning: Locale not supported by X, falling back to 'C' locale.\n");
+ setlocale(LC_ALL, "C");
+ }
+
}
#endif
-#if CYGDEBUG || YES
winDebug("InitOutput - Returning.\n");
-#endif
}
/*
@@ -989,7 +1008,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;
}
@@ -1030,7 +1049,7 @@ winCheckDisplayNumber(void)
}
if (GetLastError() == ERROR_ALREADY_EXISTS) {
ErrorF("winCheckDisplayNumber - "
- PROJECT_NAME " is already running on display %d\n", nDisp);
+ "VCXsrv, Xming or Cygwin/X is already running on display %d\n", nDisp);
return FALSE;
}