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 <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This commit is contained in:
Jon TURNEY 2013-06-17 01:30:09 +01:00
parent 290dbff075
commit 42d1381082
2 changed files with 5 additions and 7 deletions

View File

@ -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 */

View File

@ -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;