hw/xwin: Push winClipboardShutdown() into winclipboardinit.c
Push winClipboardShutdown() into winclipboardinit.c This lets us make g_ptClipboardProc static Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This commit is contained in:
parent
6343b531d7
commit
0bb6eae4e3
|
@ -66,24 +66,11 @@ typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner,
|
||||||
/*
|
/*
|
||||||
* References to external symbols
|
* References to external symbols
|
||||||
*/
|
*/
|
||||||
#ifdef XWIN_CLIPBOARD
|
|
||||||
extern Bool g_fUnicodeClipboard;
|
|
||||||
extern Bool g_fClipboardLaunched;
|
|
||||||
extern Bool g_fClipboardStarted;
|
|
||||||
extern pthread_t g_ptClipboardProc;
|
|
||||||
extern HWND g_hwndClipboard;
|
|
||||||
extern Bool g_fClipboard;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Function prototypes
|
* Function prototypes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef XWIN_CLIPBOARD
|
|
||||||
static void
|
|
||||||
winClipboardShutdown(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
winCheckDisplayNumber(void);
|
winCheckDisplayNumber(void);
|
||||||
|
|
||||||
|
@ -125,31 +112,6 @@ static PixmapFormatRec g_PixmapFormats[] = {
|
||||||
|
|
||||||
const int NUMFORMATS = sizeof(g_PixmapFormats) / sizeof(g_PixmapFormats[0]);
|
const int NUMFORMATS = sizeof(g_PixmapFormats) / sizeof(g_PixmapFormats[0]);
|
||||||
|
|
||||||
#ifdef XWIN_CLIPBOARD
|
|
||||||
static void
|
|
||||||
winClipboardShutdown(void)
|
|
||||||
{
|
|
||||||
/* Close down clipboard resources */
|
|
||||||
if (g_fClipboard && g_fClipboardLaunched && g_fClipboardStarted) {
|
|
||||||
/* Synchronously destroy the clipboard window */
|
|
||||||
if (g_hwndClipboard != NULL) {
|
|
||||||
SendMessage(g_hwndClipboard, WM_DESTROY, 0, 0);
|
|
||||||
/* NOTE: g_hwndClipboard is set to NULL in winclipboardthread.c */
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
|
|
||||||
static const ExtensionModule xwinExtensions[] = {
|
static const ExtensionModule xwinExtensions[] = {
|
||||||
#ifdef GLXEXT
|
#ifdef GLXEXT
|
||||||
{ GlxExtensionInit, "GLX", &noGlxExtension },
|
{ GlxExtensionInit, "GLX", &noGlxExtension },
|
||||||
|
|
|
@ -794,6 +794,9 @@ Bool
|
||||||
|
|
||||||
void
|
void
|
||||||
winFixClipboardChain(void);
|
winFixClipboardChain(void);
|
||||||
|
|
||||||
|
void
|
||||||
|
winClipboardShutdown(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -46,10 +46,17 @@ int winProcSetSelectionOwner(ClientPtr /* client */ );
|
||||||
* References to external symbols
|
* References to external symbols
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern pthread_t g_ptClipboardProc;
|
|
||||||
extern winDispatchProcPtr winProcSetSelectionOwnerOrig;
|
extern winDispatchProcPtr winProcSetSelectionOwnerOrig;
|
||||||
extern Bool g_fClipboard;
|
extern Bool g_fClipboard;
|
||||||
extern HWND g_hwndClipboard;
|
extern HWND g_hwndClipboard;
|
||||||
|
extern Bool g_fClipboardLaunched;
|
||||||
|
extern Bool g_fClipboardStarted;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local variables
|
||||||
|
*/
|
||||||
|
|
||||||
|
static pthread_t g_ptClipboardProc;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Intialize the Clipboard module
|
* Intialize the Clipboard module
|
||||||
|
@ -76,6 +83,29 @@ winInitClipboard(void)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
winClipboardShutdown(void)
|
||||||
|
{
|
||||||
|
/* Close down clipboard resources */
|
||||||
|
if (g_fClipboard && g_fClipboardLaunched && g_fClipboardStarted) {
|
||||||
|
/* Synchronously destroy the clipboard window */
|
||||||
|
if (g_hwndClipboard != NULL) {
|
||||||
|
SendMessage(g_hwndClipboard, WM_DESTROY, 0, 0);
|
||||||
|
/* NOTE: g_hwndClipboard is set to NULL in winclipboardthread.c */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* 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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create the Windows window that we use to receive Windows messages
|
* Create the Windows window that we use to receive Windows messages
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -96,7 +96,6 @@ Bool g_fUnicodeClipboard = TRUE;
|
||||||
Bool g_fClipboard = TRUE;
|
Bool g_fClipboard = TRUE;
|
||||||
Bool g_fClipboardLaunched = FALSE;
|
Bool g_fClipboardLaunched = FALSE;
|
||||||
Bool g_fClipboardStarted = FALSE;
|
Bool g_fClipboardStarted = FALSE;
|
||||||
pthread_t g_ptClipboardProc;
|
|
||||||
HWND g_hwndClipboard = NULL;
|
HWND g_hwndClipboard = NULL;
|
||||||
void *g_pClipboardDisplay = NULL;
|
void *g_pClipboardDisplay = NULL;
|
||||||
Window g_iClipboardWindow = None;
|
Window g_iClipboardWindow = None;
|
||||||
|
|
Loading…
Reference in New Issue