aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-11 12:31:56 +0000
committermarha <marha@users.sourceforge.net>2009-09-11 12:31:56 +0000
commitde33a8e7273592eefd303a94e87a8b38592099a1 (patch)
tree6d3dd0379c8dae67fd57478239dce282d997ec05
parentb8d02796c52d4cedbacb49099edf9e59970276f7 (diff)
downloadvcxsrv-de33a8e7273592eefd303a94e87a8b38592099a1.tar.gz
vcxsrv-de33a8e7273592eefd303a94e87a8b38592099a1.tar.bz2
vcxsrv-de33a8e7273592eefd303a94e87a8b38592099a1.zip
- Removed waiting until clipboard was started after being launched in
function winProcSetSelectionOwner. (This was causing a dead lock) - Changed welcome message - Synchronised winclipboardxevents with the version on the release branch (Removed calls to XLockDisplay and XUnlockDisplay) - Call to XInitThreads has been moved to the beginning of dix\main. This function should be called before any call to a Xlib function.
-rw-r--r--xorg-server/dix/main.c8
-rw-r--r--xorg-server/hw/xwin/winclipboardthread.c9
-rw-r--r--xorg-server/hw/xwin/winclipboardwrappers.c11
-rw-r--r--xorg-server/hw/xwin/winclipboardxevents.c10
-rw-r--r--xorg-server/hw/xwin/winmultiwindowwm.c14
-rw-r--r--xorg-server/hw/xwin/winprocarg.c2
6 files changed, 11 insertions, 43 deletions
diff --git a/xorg-server/dix/main.c b/xorg-server/dix/main.c
index e667b2fc7..d607c8431 100644
--- a/xorg-server/dix/main.c
+++ b/xorg-server/dix/main.c
@@ -153,6 +153,14 @@ int main(int argc, char *argv[], char *envp[])
ptw32_processInitialize();
display = "0";
+ #ifdef WIN32
+ /* In Win32 we have different threads call Xlib functions (depending
+ on the commandline options given).
+ XInitThreads has to be called before
+ any xlib function is called (aoccording to the man page) */
+ XInitThreads();
+ #endif
+
InitRegions();
pixman_disable_out_of_bounds_workaround();
diff --git a/xorg-server/hw/xwin/winclipboardthread.c b/xorg-server/hw/xwin/winclipboardthread.c
index b459e81c0..7912506e5 100644
--- a/xorg-server/hw/xwin/winclipboardthread.c
+++ b/xorg-server/hw/xwin/winclipboardthread.c
@@ -43,7 +43,6 @@
#ifdef _MSC_VER
#define snprintf _snprintf
-#define max __max
#endif
/*
@@ -126,13 +125,6 @@ winClipboardProc (void *pvNotUsed)
/* Save the Unicode support flag in a global */
g_fUseUnicode = fUseUnicode;
- /* Allow multiple threads to access Xlib */
- if (XInitThreads () == 0)
- {
- ErrorF ("winClipboardProc - XInitThreads failed.\n");
- goto thread_errorexit;
- }
-
/* See if X supports the current locale */
if (XSupportsLocale () == False)
{
@@ -315,6 +307,7 @@ winClipboardProc (void *pvNotUsed)
goto thread_errorexit;
}
+ ErrorF ("winClipboardProc - Started\n");
/* Signal that the clipboard client has started */
g_fClipboardStarted = TRUE;
diff --git a/xorg-server/hw/xwin/winclipboardwrappers.c b/xorg-server/hw/xwin/winclipboardwrappers.c
index 233c0489b..3d5323cc7 100644
--- a/xorg-server/hw/xwin/winclipboardwrappers.c
+++ b/xorg-server/hw/xwin/winclipboardwrappers.c
@@ -342,20 +342,9 @@ winProcSetSelectionOwner (ClientPtr client)
/* Abort if clipboard not completely initialized yet */
if (!g_fClipboardStarted)
{
- if (g_fClipboardLaunched)
- {
- // Just wait until it is started
- ErrorF ("winProcSetSelectionOwner - waiting to be started.\n");
- while (g_fClipboardLaunched && !g_fClipboardStarted)
- Sleep(0);
- ErrorF ("winProcSetSelectionOwner - Clipboard started.\n");
- }
- else
- {
ErrorF ("winProcSetSelectionOwner - Clipboard not yet started, "
"aborting.\n");
goto winProcSetSelectionOwner_Done;
- }
}
/* Grab window if we have one */
diff --git a/xorg-server/hw/xwin/winclipboardxevents.c b/xorg-server/hw/xwin/winclipboardxevents.c
index 25ce15f07..615a2cb65 100644
--- a/xorg-server/hw/xwin/winclipboardxevents.c
+++ b/xorg-server/hw/xwin/winclipboardxevents.c
@@ -188,7 +188,6 @@ winClipboardFlushXEvents (HWND hwnd,
}
/* Check that clipboard format is available */
- XLockDisplay (pDisplay);
if (fUseUnicode
&& !IsClipboardFormatAvailable (CF_UNICODETEXT))
{
@@ -201,7 +200,6 @@ winClipboardFlushXEvents (HWND hwnd,
lasthwnd = hwnd;
/* Abort */
- XUnlockDisplay (pDisplay);
fAbort = TRUE;
goto winClipboardFlushXEvents_SelectionRequest_Done;
}
@@ -212,7 +210,6 @@ winClipboardFlushXEvents (HWND hwnd,
"available from Win32 clipboard. Aborting.\n");
/* Abort */
- XUnlockDisplay (pDisplay);
fAbort = TRUE;
goto winClipboardFlushXEvents_SelectionRequest_Done;
}
@@ -231,7 +228,6 @@ winClipboardFlushXEvents (HWND hwnd,
GetLastError ());
/* Abort */
- XUnlockDisplay (pDisplay);
fAbort = TRUE;
goto winClipboardFlushXEvents_SelectionRequest_Done;
}
@@ -269,11 +265,10 @@ winClipboardFlushXEvents (HWND hwnd,
if (!hGlobal)
{
ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
- "GetClipboardData () failed: 0x%08x\n",
+ "GetClipboardData () failed: %08x\n",
GetLastError ());
/* Abort */
- XUnlockDisplay (pDisplay);
fAbort = TRUE;
goto winClipboardFlushXEvents_SelectionRequest_Done;
}
@@ -309,7 +304,6 @@ winClipboardFlushXEvents (HWND hwnd,
/* Convert DOS string to UNIX string */
winClipboardDOStoUNIX (pszConvertData, strlen (pszConvertData));
- XUnlockDisplay (pDisplay);
/* Setup our text list */
pszTextList[0] = pszConvertData;
@@ -694,7 +688,6 @@ winClipboardFlushXEvents (HWND hwnd,
xtpText.nitems = 0;
/* Convert the X clipboard string to DOS format */
- XLockDisplay (pDisplay);
winClipboardUNIXtoDOS ((unsigned char **)&pszReturnData, strlen (pszReturnData));
if (fUseUnicode)
@@ -802,7 +795,6 @@ winClipboardFlushXEvents (HWND hwnd,
*/
winClipboardFlushXEvents_SelectionNotify_Done:
- XUnlockDisplay (pDisplay);
/* Free allocated resources */
if (ppszTextList)
XFreeStringList (ppszTextList);
diff --git a/xorg-server/hw/xwin/winmultiwindowwm.c b/xorg-server/hw/xwin/winmultiwindowwm.c
index 8a05eb3fc..2ce248c63 100644
--- a/xorg-server/hw/xwin/winmultiwindowwm.c
+++ b/xorg-server/hw/xwin/winmultiwindowwm.c
@@ -900,13 +900,6 @@ winMultiWindowXMsgProc (void *pArg)
ErrorF ("winMultiWindowXMsgProc - pthread_mutex_lock () returned.\n");
- /* Allow multiple threads to access Xlib */
- if (XInitThreads () == 0)
- {
- ErrorF ("winMultiWindowXMsgProc - XInitThreads () failed. Exiting.\n");
- pthread_exit (NULL);
- }
-
/* See if X supports the current locale */
if (XSupportsLocale () == False)
{
@@ -1229,13 +1222,6 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
ErrorF ("winInitMultiWindowWM - pthread_mutex_lock () returned.\n");
- /* Allow multiple threads to access Xlib */
- if (XInitThreads () == 0)
- {
- ErrorF ("winInitMultiWindowWM - XInitThreads () failed. Exiting.\n");
- pthread_exit (NULL);
- }
-
/* See if X supports the current locale */
if (XSupportsLocale () == False)
{
diff --git a/xorg-server/hw/xwin/winprocarg.c b/xorg-server/hw/xwin/winprocarg.c
index 69d6ab7ac..305a82118 100644
--- a/xorg-server/hw/xwin/winprocarg.c
+++ b/xorg-server/hw/xwin/winprocarg.c
@@ -1537,7 +1537,7 @@ winLogVersionInfo (void)
return;
s_fBeenHere = TRUE;
- ErrorF ("Welcome to the XWin X Server\n");
+ ErrorF ("Welcome to the VcXsrv X Server\n");
ErrorF ("Vendor: %s\n", VENDOR_STRING);
ErrorF ("Release: %d.%d.%d.%d (%d)\n\n", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, XORG_VERSION_CURRENT);
ErrorF ("Contact: %s\n\n", VENDOR_CONTACT);