mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-30 02:40:08 +01:00
Sync with XWin Server 4.3.0-42 release. Minor fixes to clipboard code to
hopefully fix some crashes. Cleanup of multi-window mode exit messages.
This commit is contained in:
parent
cf52f32ac3
commit
47fa03e091
6 changed files with 61 additions and 21 deletions
|
|
@ -57,6 +57,9 @@ int g_iLogVerbose = 4;
|
|||
char * g_pszLogFile = WIN_LOG_FNAME;
|
||||
Bool g_fLogInited = FALSE;
|
||||
|
||||
extern Bool g_fClipboardLaunched;
|
||||
extern Bool g_fClipboardStarted;
|
||||
|
||||
extern HMODULE g_hmodDirectDraw;
|
||||
extern FARPROC g_fpDirectDrawCreate;
|
||||
extern FARPROC g_fpDirectDrawCreateClipper;
|
||||
|
|
@ -123,7 +126,7 @@ OsVendorReset (void)
|
|||
ErrorF ("OsVendorReset - Hello\n");
|
||||
|
||||
/* Close down clipboard resources */
|
||||
if (g_fClipboard)
|
||||
if (g_fClipboard && g_fClipboardLaunched && g_fClipboardStarted)
|
||||
{
|
||||
/* Synchronously destroy the clipboard window */
|
||||
if (g_hwndClipboard != NULL)
|
||||
|
|
|
|||
|
|
@ -102,6 +102,17 @@ winProcQueryTree (ClientPtr client)
|
|||
return iReturn;
|
||||
}
|
||||
|
||||
/* Make errors more obvious */
|
||||
winProcQueryTreeOrig = NULL;
|
||||
|
||||
/* Do nothing if clipboard is not enabled */
|
||||
if (!g_fClipboard)
|
||||
{
|
||||
ErrorF ("winProcQueryTree - Clipboard is not enabled, "
|
||||
"returning.\n");
|
||||
return iReturn;
|
||||
}
|
||||
|
||||
/* If the clipboard client has already been started, abort */
|
||||
if (g_fClipboardLaunched)
|
||||
{
|
||||
|
|
@ -172,6 +183,19 @@ winProcEstablishConnection (ClientPtr client)
|
|||
|
||||
ErrorF ("winProcEstablishConnection - Hello\n");
|
||||
|
||||
/* Do nothing if clipboard is not enabled */
|
||||
if (!g_fClipboard)
|
||||
{
|
||||
ErrorF ("winProcEstablishConnection - Clipboard is not enabled, "
|
||||
"returning.\n");
|
||||
|
||||
/* Unwrap the original function, call it, and return */
|
||||
InitialVector[2] = winProcEstablishConnectionOrig;
|
||||
iReturn = (*winProcEstablishConnectionOrig) (client);
|
||||
winProcEstablishConnectionOrig = NULL;
|
||||
return iReturn;
|
||||
}
|
||||
|
||||
/* Watch for server reset */
|
||||
if (s_ulServerGeneration != serverGeneration)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
int i;
|
||||
Bool fAbort = FALSE;
|
||||
Bool fCloseClipboard = FALSE;
|
||||
Bool fSetClipboardData = TRUE;
|
||||
|
||||
/* Get the next event - will not block because one is ready */
|
||||
XNextEvent (pDisplay, &event);
|
||||
|
|
@ -734,6 +735,9 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
else
|
||||
SetClipboardData (CF_TEXT, hGlobal);
|
||||
|
||||
/* Flag that SetClipboardData has been called */
|
||||
fSetClipboardData = FALSE;
|
||||
|
||||
/*
|
||||
* NOTE: Do not try to free pszGlobalData, it is owned by
|
||||
* Windows after the call to SetClipboardData ().
|
||||
|
|
@ -751,6 +755,10 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
free (pwszUnicodeStr);
|
||||
if (hGlobal && pszGlobalData)
|
||||
GlobalUnlock (hGlobal);
|
||||
if (fSetClipboardData && fUnicodeSupport)
|
||||
SetClipboardData (CF_UNICODETEXT, NULL);
|
||||
if (fSetClipboardData && !fUnicodeSupport)
|
||||
SetClipboardData (CF_TEXT, NULL);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@ winDispatchProcPtr winProcSetSelectionOwnerOrig = NULL;
|
|||
Bool g_fClipboardLaunched = FALSE;
|
||||
Bool g_fClipboardStarted = FALSE;
|
||||
pthread_t g_ptClipboardProc;
|
||||
Bool g_fClipboardStarted;
|
||||
HWND g_hwndClipboard;
|
||||
void *g_pClipboardDisplay;
|
||||
Window g_iClipboardWindow;
|
||||
|
|
@ -98,7 +97,12 @@ Atom g_atomLastOwnedSelection;
|
|||
*/
|
||||
|
||||
void
|
||||
winInitializeGlobals ()
|
||||
winInitializeGlobals (void)
|
||||
{
|
||||
g_fClipboardLaunched = FALSE;
|
||||
g_fClipboardStarted = FALSE;
|
||||
g_iClipboardWindow = None;
|
||||
g_pClipboardDisplay = NULL;
|
||||
g_atomLastOwnedSelection = None;
|
||||
g_hwndClipboard = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
#ifndef __WIN_MSG_H__
|
||||
#define __WIN_MSG_H__
|
||||
/*
|
||||
*Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
|
||||
*
|
||||
|
|
@ -29,8 +31,6 @@
|
|||
*/
|
||||
/* $XFree86: xc/programs/Xserver/hw/xwin/winmsg.h,v 1.2 2003/10/02 13:30:10 eich Exp $ */
|
||||
|
||||
#ifndef __WIN_MSG_H__
|
||||
#define __WIN_MSG_H__
|
||||
|
||||
/*
|
||||
* Function prototypes
|
||||
|
|
|
|||
|
|
@ -661,7 +661,7 @@ winMultiWindowWMProc (void *pArg)
|
|||
break;
|
||||
|
||||
default:
|
||||
ErrorF ("winMultiWindowWMProc - Unknown Message.\n");
|
||||
ErrorF ("winMultiWindowWMProc - Unknown Message. Exiting.\n");
|
||||
pthread_exit (NULL);
|
||||
break;
|
||||
}
|
||||
|
|
@ -688,7 +688,6 @@ winMultiWindowWMProc (void *pArg)
|
|||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* X message procedure
|
||||
*/
|
||||
|
|
@ -712,7 +711,7 @@ winMultiWindowXMsgProc (void *pArg)
|
|||
/* Check that argument pointer is not invalid */
|
||||
if (pProcArg == NULL)
|
||||
{
|
||||
ErrorF ("winMultiWindowXMsgProc - pProcArg is NULL, bailing.\n");
|
||||
ErrorF ("winMultiWindowXMsgProc - pProcArg is NULL. Exiting.\n");
|
||||
pthread_exit (NULL);
|
||||
}
|
||||
|
||||
|
|
@ -722,7 +721,8 @@ winMultiWindowXMsgProc (void *pArg)
|
|||
iReturn = pthread_mutex_lock (pProcArg->ppmServerStarted);
|
||||
if (iReturn != 0)
|
||||
{
|
||||
ErrorF ("winMultiWindowXMsgProc - pthread_mutex_lock () failed: %d\n",
|
||||
ErrorF ("winMultiWindowXMsgProc - pthread_mutex_lock () failed: %d. "
|
||||
"Exiting.\n",
|
||||
iReturn);
|
||||
pthread_exit (NULL);
|
||||
}
|
||||
|
|
@ -732,7 +732,7 @@ winMultiWindowXMsgProc (void *pArg)
|
|||
/* Allow multiple threads to access Xlib */
|
||||
if (XInitThreads () == 0)
|
||||
{
|
||||
ErrorF ("winMultiWindowXMsgProc - XInitThreads () failed.\n");
|
||||
ErrorF ("winMultiWindowXMsgProc - XInitThreads () failed. Exiting.\n");
|
||||
pthread_exit (NULL);
|
||||
}
|
||||
|
||||
|
|
@ -757,13 +757,13 @@ winMultiWindowXMsgProc (void *pArg)
|
|||
&& iReturn != WIN_JMP_OKAY)
|
||||
{
|
||||
/* setjmp returned an unknown value, exit */
|
||||
ErrorF ("winInitMultiWindowXMsgProc - setjmp returned: %d exiting\n",
|
||||
ErrorF ("winInitMultiWindowXMsgProc - setjmp returned: %d. Exiting.\n",
|
||||
iReturn);
|
||||
pthread_exit (NULL);
|
||||
}
|
||||
else if (iReturn == WIN_JMP_ERROR_IO)
|
||||
{
|
||||
ErrorF ("winInitMultiWindowXMsgProc - Caught IO Error, shutting down\n");
|
||||
ErrorF ("winInitMultiWindowXMsgProc - Caught IO Error. Exiting.\n");
|
||||
pthread_exit (NULL);
|
||||
}
|
||||
|
||||
|
|
@ -803,8 +803,8 @@ winMultiWindowXMsgProc (void *pArg)
|
|||
/* Make sure that the display opened */
|
||||
if (pProcArg->pDisplay == NULL)
|
||||
{
|
||||
ErrorF ("winMultiWindowXMsgProc - "
|
||||
"Failed opening the display, giving up.\n\f");
|
||||
ErrorF ("winMultiWindowXMsgProc - Failed opening the display. "
|
||||
"Exiting.\n");
|
||||
pthread_exit (NULL);
|
||||
}
|
||||
|
||||
|
|
@ -978,7 +978,7 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
|
|||
/* Check that argument pointer is not invalid */
|
||||
if (pProcArg == NULL)
|
||||
{
|
||||
ErrorF ("winInitMultiWindowWM - pProcArg is NULL, bailing.\n");
|
||||
ErrorF ("winInitMultiWindowWM - pProcArg is NULL. Exiting.\n");
|
||||
pthread_exit (NULL);
|
||||
}
|
||||
|
||||
|
|
@ -988,7 +988,8 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
|
|||
iReturn = pthread_mutex_lock (pProcArg->ppmServerStarted);
|
||||
if (iReturn != 0)
|
||||
{
|
||||
ErrorF ("winInitMultiWindowWM - pthread_mutex_lock () failed: %d\n",
|
||||
ErrorF ("winInitMultiWindowWM - pthread_mutex_lock () failed: %d. "
|
||||
"Exiting.\n",
|
||||
iReturn);
|
||||
pthread_exit (NULL);
|
||||
}
|
||||
|
|
@ -998,7 +999,7 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
|
|||
/* Allow multiple threads to access Xlib */
|
||||
if (XInitThreads () == 0)
|
||||
{
|
||||
ErrorF ("winInitMultiWindowWM - XInitThreads () failed.\n");
|
||||
ErrorF ("winInitMultiWindowWM - XInitThreads () failed. Exiting.\n");
|
||||
pthread_exit (NULL);
|
||||
}
|
||||
|
||||
|
|
@ -1022,13 +1023,13 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
|
|||
&& iReturn != WIN_JMP_OKAY)
|
||||
{
|
||||
/* setjmp returned an unknown value, exit */
|
||||
ErrorF ("winInitMultiWindowWM - setjmp returned: %d exiting\n",
|
||||
ErrorF ("winInitMultiWindowWM - setjmp returned: %d. Exiting.\n",
|
||||
iReturn);
|
||||
pthread_exit (NULL);
|
||||
}
|
||||
else if (iReturn == WIN_JMP_ERROR_IO)
|
||||
{
|
||||
ErrorF ("winInitMultiWindowWM - Caught IO Error, shutting down\n");
|
||||
ErrorF ("winInitMultiWindowWM - Caught IO Erro. Exiting.\n");
|
||||
pthread_exit (NULL);
|
||||
}
|
||||
|
||||
|
|
@ -1068,8 +1069,8 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
|
|||
/* Make sure that the display opened */
|
||||
if (pWMInfo->pDisplay == NULL)
|
||||
{
|
||||
ErrorF ("winInitMultiWindowWM - Failed opening the display, "
|
||||
"giving up.\n\f");
|
||||
ErrorF ("winInitMultiWindowWM - Failed opening the display. "
|
||||
"Exiting.\n");
|
||||
pthread_exit (NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue