diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2013-06-17 00:07:01 +0100 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2013-06-20 14:29:41 +0100 |
commit | 7da5f8ed639ba4ed0b73904686aeea0e70884ac7 (patch) | |
tree | 5f82572928adf869dbfb0c5b316630b8e428a40b | |
parent | 6ae28da313adfeb5ab00b5091a445d45fa205a55 (diff) |
Push winClipboardShutdown() into winclipboardinit.c
Push winClipboardShutdown() into winclipboardinit.c
This lets us make g_ptClipboardProc static
-rw-r--r-- | hw/xwin/InitOutput.c | 40 | ||||
-rw-r--r-- | hw/xwin/win.h | 3 | ||||
-rw-r--r-- | hw/xwin/winclipboardinit.c | 32 | ||||
-rw-r--r-- | hw/xwin/winglobals.c | 1 |
4 files changed, 34 insertions, 42 deletions
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 9afd6a72b..91a711709 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -63,27 +63,12 @@ typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner, /* * 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 - extern Bool noRRXineramaExtension; /* * Function prototypes */ -#ifdef XWIN_CLIPBOARD -static void - winClipboardShutdown(void); -#endif - - void winLogCommandLine(int argc, char *argv[]); @@ -127,31 +112,6 @@ static PixmapFormatRec g_PixmapFormats[] = { 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[] = { #ifdef GLXEXT { GlxExtensionInit, "GLX", &noGlxExtension }, diff --git a/hw/xwin/win.h b/hw/xwin/win.h index 5e0ca8901..52d04150d 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -794,6 +794,9 @@ Bool void winFixClipboardChain(void); + +void + winClipboardShutdown(void); #endif /* diff --git a/hw/xwin/winclipboardinit.c b/hw/xwin/winclipboardinit.c index 304e6df9f..904704558 100644 --- a/hw/xwin/winclipboardinit.c +++ b/hw/xwin/winclipboardinit.c @@ -46,10 +46,17 @@ int winProcSetSelectionOwner(ClientPtr /* client */ ); * References to external symbols */ -extern pthread_t g_ptClipboardProc; extern winDispatchProcPtr winProcSetSelectionOwnerOrig; extern Bool g_fClipboard; extern HWND g_hwndClipboard; +extern Bool g_fClipboardLaunched; +extern Bool g_fClipboardStarted; + +/* + * Local variables + */ + +static pthread_t g_ptClipboardProc; /* * Intialize the Clipboard module @@ -76,6 +83,29 @@ winInitClipboard(void) 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 recieve Windows messages */ diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c index b9ad294d5..b0d6ffc3c 100644 --- a/hw/xwin/winglobals.c +++ b/hw/xwin/winglobals.c @@ -96,7 +96,6 @@ Bool g_fUnicodeClipboard = TRUE; Bool g_fClipboard = TRUE; Bool g_fClipboardLaunched = FALSE; Bool g_fClipboardStarted = FALSE; -pthread_t g_ptClipboardProc; HWND g_hwndClipboard = NULL; void *g_pClipboardDisplay = NULL; Window g_iClipboardWindow = None; |