From 42d13810822f6b48771d77b09c0ef7cc2356ede5 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 17 Jun 2013 01:30:09 +0100 Subject: [PATCH] hw/xwin: Hoist setting of g_fClipboardStarted flag up one level Hoist the setting of g_fClipboardStarted flag up one level. Also move up the clearing of the g_fClipboardLaunched at the end of clipboard function. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winclipboardinit.c | 5 +++++ hw/xwin/winclipboardthread.c | 7 ------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/xwin/winclipboardinit.c b/hw/xwin/winclipboardinit.c index a3c1261d7..0b895cb8c 100644 --- a/hw/xwin/winclipboardinit.c +++ b/hw/xwin/winclipboardinit.c @@ -79,9 +79,14 @@ winClipboardThreadProc(void *arg) /* Flag that clipboard client has been launched */ g_fClipboardLaunched = TRUE; + g_fClipboardStarted = TRUE; winClipboardProc(arg); + /* Flag that clipboard client has stopped */ + g_fClipboardLaunched = FALSE; + g_fClipboardStarted = FALSE; + /* checking if we need to restart */ if (clipboardRestarts >= WIN_CLIPBOARD_RETRIES) { /* terminates clipboard thread but the main server still lives */ diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c index fd1fc0731..2ef73bde9 100644 --- a/hw/xwin/winclipboardthread.c +++ b/hw/xwin/winclipboardthread.c @@ -52,8 +52,6 @@ */ extern Bool g_fUnicodeClipboard; -extern Bool g_fClipboardStarted; -extern Bool g_fClipboardLaunched; extern Bool g_fClipboard; extern HWND g_hwndClipboard; extern void *g_pClipboardDisplay; @@ -274,9 +272,6 @@ winClipboardProc(void *pvNotUsed) ErrorF("winClipboardProc - winClipboardFlushWindowsMessageQueue failed\n"); } - /* Signal that the clipboard client has started */ - g_fClipboardStarted = TRUE; - /* Loop for X events */ while (1) { /* Setup the file descriptor set */ @@ -395,8 +390,6 @@ winClipboardProc(void *pvNotUsed) #endif /* global clipboard variable reset */ - g_fClipboardLaunched = FALSE; - g_fClipboardStarted = FALSE; g_iClipboardWindow = None; g_pClipboardDisplay = NULL; g_hwndClipboard = NULL;