aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winclipboardxevents.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/winclipboardxevents.c')
-rw-r--r--xorg-server/hw/xwin/winclipboardxevents.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/xorg-server/hw/xwin/winclipboardxevents.c b/xorg-server/hw/xwin/winclipboardxevents.c
index ec40814db..1d912936a 100644
--- a/xorg-server/hw/xwin/winclipboardxevents.c
+++ b/xorg-server/hw/xwin/winclipboardxevents.c
@@ -188,6 +188,7 @@ winClipboardFlushXEvents (HWND hwnd,
}
/* Check that clipboard format is available */
+ XLockDisplay (pDisplay);
if (fUseUnicode
&& !IsClipboardFormatAvailable (CF_UNICODETEXT))
{
@@ -200,6 +201,7 @@ winClipboardFlushXEvents (HWND hwnd,
lasthwnd = hwnd;
/* Abort */
+ XUnlockDisplay (pDisplay);
fAbort = TRUE;
goto winClipboardFlushXEvents_SelectionRequest_Done;
}
@@ -210,6 +212,7 @@ winClipboardFlushXEvents (HWND hwnd,
"available from Win32 clipboard. Aborting.\n");
/* Abort */
+ XUnlockDisplay (pDisplay);
fAbort = TRUE;
goto winClipboardFlushXEvents_SelectionRequest_Done;
}
@@ -228,6 +231,7 @@ winClipboardFlushXEvents (HWND hwnd,
GetLastError ());
/* Abort */
+ XUnlockDisplay (pDisplay);
fAbort = TRUE;
goto winClipboardFlushXEvents_SelectionRequest_Done;
}
@@ -269,6 +273,7 @@ winClipboardFlushXEvents (HWND hwnd,
GetLastError ());
/* Abort */
+ XUnlockDisplay (pDisplay);
fAbort = TRUE;
goto winClipboardFlushXEvents_SelectionRequest_Done;
}
@@ -304,6 +309,7 @@ winClipboardFlushXEvents (HWND hwnd,
/* Convert DOS string to UNIX string */
winClipboardDOStoUNIX (pszConvertData, strlen (pszConvertData));
+ XUnlockDisplay (pDisplay);
/* Setup our text list */
pszTextList[0] = pszConvertData;
@@ -644,7 +650,7 @@ winClipboardFlushXEvents (HWND hwnd,
{
iReturnDataLen += strlen(ppszTextList[i]);
}
- pszReturnData = malloc (iReturnDataLen + 1);
+ pszReturnData = (char *) malloc (iReturnDataLen + 1);
pszReturnData[0] = '\0';
for (i = 0; i < iCount; i++)
{
@@ -655,7 +661,7 @@ winClipboardFlushXEvents (HWND hwnd,
{
ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
"X*TextPropertyToTextList list_return is NULL.\n");
- pszReturnData = malloc (1);
+ pszReturnData = (char *) malloc (1);
pszReturnData[0] = '\0';
}
}
@@ -675,7 +681,7 @@ winClipboardFlushXEvents (HWND hwnd,
ErrorF ("%d", iReturn);
break;
}
- pszReturnData = malloc (1);
+ pszReturnData = (char *) malloc (1);
pszReturnData[0] = '\0';
}
@@ -688,7 +694,8 @@ winClipboardFlushXEvents (HWND hwnd,
xtpText.nitems = 0;
/* Convert the X clipboard string to DOS format */
- winClipboardUNIXtoDOS (&pszReturnData, strlen (pszReturnData));
+ XLockDisplay (pDisplay);
+ winClipboardUNIXtoDOS ((unsigned char **)&pszReturnData, strlen (pszReturnData));
if (fUseUnicode)
{
@@ -795,6 +802,7 @@ winClipboardFlushXEvents (HWND hwnd,
*/
winClipboardFlushXEvents_SelectionNotify_Done:
+ XUnlockDisplay (pDisplay);
/* Free allocated resources */
if (ppszTextList)
XFreeStringList (ppszTextList);